<template>
<button @click="open">打开弹窗</button>
<uni-popup ref="popup" :mask-click="false">
<p>弹出层</p>
<button @click="close">关闭</button>
<button @click="close">确认</button>
</uni-popup>
</template>
<script setup>
import { ref } from 'vue'
const popup = ref(null)
const open = () => {
popup.value.open('top') // 调用弹窗组件的打开方法
}
const close = () => {
popup.value.close() // 调用弹窗组件的关闭方法
}