<template>
<view>
<button @click="openPopup">打开弹窗</button>
<uni-popup ref="signup" type="bottom"></uni-popup>
</view>
</template>
<script>
import { reactive, toRefs, ref } from 'vue'
import uniPopup from '@/components/uni-popup/uni-popup.vue'
export default {
components: { uniPopup },
setup () {
const signup = ref(null)
function openPopup() {
signup.open()
}
return {
openPopup,
signup
}
},
}
</script>
9***@qq.com
- 发布:2021-11-12 09:29
- 更新:2022-03-20 17:01
- 阅读:2423
const popup = ref(null)
const toggle = type => {
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
popup.value.open(type)
}
const closeNotice = () => {
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
popup.value.close()
}
刚测试 没问题
你先打印一下signup.value有没有值,然后signup.value.open()这样调用
我这边打印xxx.value元素的值是null
https://ask.dcloud.net.cn/question/133989
s***@outlook.com
你是小程序试的码?我这里微信小程序不行
2022-05-08 21:18