最近在做一个注册页面,背景是一个视频。由于使用uniapp开发的,所以这坑只能慢慢爬
官网建议使用nvue做关于视频的页面。所以这个页面也是用nvue做的。
大坑:在app端使用nvue页面不能设置高度,所以需要设置高度的地方在CSS中使用条件编译
话不多说上代码
<template>
<view class="login-box" :style="{height:screenHeight+'px'}">
<view class="video-background">
<video
id="videoRef"
src="https://klxxcdn.oss-cn-hangzhou.aliyuncs.com/histudy/hrm/media/bg1.mp4"
object-fit="cover"
:autoplay="true"
:controls="false"
:muted="true"
:loop="true"
:enable-progress-gesture="false"
class="video"
/>
</view&g