父级页面
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area" @click="popOpen">
<text class="title">{{title}}</text>
</view>
<ly-popup ref="popRef" :btnDis="btnDis"></ly-popup>
</view>
</template>
<script setup>
import { ref } from 'vue';
const title = ref('点击弹出测试弹窗')
const popRef = ref(null)
const btnDis = ref(true)
const popOpen = ()=>{
console.log(popRef.value)
popRef.value.openCommPop()
setTimeout(()=>{
btnDis.value = false
}, 2000)
}
</script>
ly-popup组件
<template>
<uni-popup ref="popCommmRef" type="bottom">
<slot>
<view style="background-color: #FFFFFF;text-align: center;height: 200px;">
测试弹窗内容
<button type="primary" :disabled="props.btnDis">测按钮</button>
</view>
</slot>
</uni-popup>
</template>
<script setup>
import { ref } from 'vue';
const props = defineProps({
btnDis: false
})
const popCommmRef = ref(null)
const openCommPop = ()=>{
popCommmRef.value.open()
}
defineExpose({
openCommPop
})
</script>
FE_liyangyang (作者)
我看到了,但是这不应该是组件的bug,修复组件吗?
2025-02-17 17:59
爱豆豆
回复 FE_liyangyang: 是的 但是官方修复bug的话 时间不确定 你可以等官方修复好在用 或者 用别的方法先解决问题
2025-02-17 18:15
FE_liyangyang (作者)
回复 爱豆豆: 嘻嘻,谢谢喽,我意思就是提交上去这个bug,官方啥时候修是他的事
2025-02-17 18:30