<template>
<button class="button" type="primary" @click="toggle('bottom')"><text class="button-text">底部</text></button>
<view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content" ><text
class="text">popup 内容</text></view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
popupShow:false
}
},methods: {
toggle(type) {
if (this.popupShow == false) {// 触发弹出
this.$refs.popup.open(type)
} else{// 关闭弹出
this.$refs.popup.close()
}
},
change(e) {
this.popupShow = e.show
// console.log('当前模式:' + e.type + ',状态:' + e.show);
},}
}
</script>