cover-image覆盖video,点击cover-image删除视频后,cover-image依然存在原来的位置
1***@qq.com
- 发布:2019-11-05 10:36
- 更新:2020-03-25 10:45
- 阅读:1390
HBuilderX 2.6.6 Android 7.0 测试没有问题
<template>
<view class="content">
<button @click="test">test</button>
<video id="video1" class="video" src=""
:controls="true" @fullscreenclick="fullscreenclick">
<cover-image v-if="showCoverView" src="/static/logo.png"></cover-image>
</video>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello',
showCoverView: true
}
},
methods: {
test() {
this.showCoverView = !this.showCoverView;
},
fullscreenclick(e) {
console.log(e.detail);
}
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
}
.video {
height: 320px;
width: 240px;
}
</style>
1***@qq.com (作者)
试过v-if了,还是不能隐藏
2019-11-05 10:52