我就用了一个官方示例,但是弹窗位置总是在左上角。
遮罩层好像还有问题...
怎么回事呢
<template>
<view>
<view class="">
1
</view>
<button @click="open">打开弹窗</button>
<uni-popup ref="popup" type="center">弹出 Popup</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
open(){
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
this.$refs.popup.open('top')
}
}
}
</script>
<style>
</style>