uniapp带视频背景的登录页面

app上video是编译为原生的所以自定义组件无法覆盖在video上层,使用压窗屏解决

bg-video.vue





subnvue.nvue

@touchmove.stop.prevent要加上,不然会导致触摸穿透






pages.json

subnvue页面会盖住bg-video页面 并且页面设置为透明,然后在subnvue页面写自定义组件

{
	"path": "pages/login/bg-video",
	"style": {
		"navigationStyle": "custom",
		"app-plus": {
			"subNVues": [{
				"id": "concat",
				"path": "/pages/login/subnvue",
				"style": {
					"position": "absolute",
					"top": "0",
					"bottom": "0",
					"left": "0",
					"right": "0",
					"background": "transparent"
				}
			 }]
		}
	}
},

你可能感兴趣的:(uni-app)