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

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

分类:uni-app

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

2023-11-02 20:40 负责人:无 分享
已邀请:
HRK

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 (作者)

    我使用的不是popup的预置按钮,是<button>组件,代码见下

    2023-11-03 19:31

mfg5413

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();  

            },
  • HRK

    嗯,好像确实是这样,我一般都是用对话框来代替按钮,直接放按钮我这边也会出一些诡异的BUG

    2023-11-03 22:16

  • mfg5413 (作者)

    回复 HRK: 好吧,你也是开发者吗?

    2023-11-04 20:11

  • HRK

    回复 2***@qq.com: 是的呢

    2023-11-07 22:01

要回复问题请先登录注册