定义CSS
.wos-scroll-no{
height:98vh;
overflow-y: hidden;
}
.wos-scroll-yes{
height:auto;
overflow-y:auto;
}
父组件绑定data
<view :class="wosScroll">
...
<view>
...
data() {
return {
wosScroll:"wos-scroll-yes",
...
修改uni-popup.vue。找到以下部分加入
open () {
this.$parent.wosScroll = 'wos-scroll-no' //新加入的 ++++++
this.$emit('change', {
show: true
})
this.showPopup = true
this.$nextTick(() => {
setTimeout(() => {
this.ani = '' + this.type
}, 30)
})
},
close (type) {
this.$parent.wosScroll = 'wos-scroll-yes' //新加入的 +++++++++
if (!this.maskClick && type) return
this.$emit('change', {
show: false
})
this.ani = ''
this.$nextTick(() => {
setTimeout(() => {
this.showPopup = false
}, 300)
})
}
1 个评论
要回复文章请先登录或注册
1***@qq.com