先看看网上的写法:
<template>
<view>
<uni-popup ref="popupCoupon" type="bottom">
xxx
</uni-popup>
</view>
</template>
<script setup>
import { ref } from 'vue';
const popupCoupon = ref(null);
console.log(popupCoupon);
popupCoupon.value.open()
setTimeout(()=>{
popupCoupon.value.close()
},1000)
</script>
但是不行,一直提示 ‘TypeError: Cannot read property 'open' of null’
HRK_01
看我楼下回复
2024-02-27 19:46