在弹出层popup上面放置的按钮,只能起一次作用,既第二次弹出后,点击按钮不起作用,没有任何反应。除非页面刷新一遍,这时按钮又起作用了,请问这是什么原因?

- 发布:2023-11-02 20:40
- 更新:2023-11-03 19:34
- 阅读:758

HRK - 一位热爱uniapp的小少年^v^
···
<view>
<!-- 输入框示例 -->
<uni-popup ref="inputDialog" type="dialog">
<uni-popup-dialog ref="inputClose" mode="input" title="输入内容" value="对话框预置提示内容!"
placeholder="请输入内容" @confirm="dialogInputConfirm"></uni-popup-dialog>
</uni-popup>
</view>
···
这边测试多次弹出也是正常生效,方便提供一下你的问题代码吗

mfg5413 (作者)
<uni-popup ref="popup" type="bottom" background-color="#ffffff">
<text> 将发表在您刚停留的</text>
<template v-for="text in text">
<text style="color:red;" v-if="text.id == scrollInto">{{text.name}}</text>
</template>
<text>频道</text>
<uni-easyinput type="textarea" autoHeight placeholder="请输入内容" ></uni-easyinput>
<button class="btn1" size="mini" type="primary" style="color: blue;" @click="closePopup"
>取消</button>
<button class="btn2" size="mini" type="primary" style="color: blue;" @click="app12"
>确定</button>
</uni-popup>
methods: {
app12(){
console.log('123456');
},
closePopup(){
console.log('关闭执行了');
this.$refs.popup.close();
},
mfg5413 (作者)
我使用的不是popup的预置按钮,是<button>组件,代码见下
2023-11-03 19:31