收藏
回答

点击button获取用户信息,多次弹窗

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows v1.02.1902010

- 提供一个最简复现 Demo

git 地址: https://gitee.com/zhtop/wxmini.git


- 当前 Bug 的表现

第一次点击出现一次弹框,第二次点击出现2次弹框,第三次点击出现三次弹框,以此类推


测试机:OPPO A83

andriod: 7.1.1





复现视频:[复现视频](https://web.ehoo100.com/static/WeChat_20190402145037.mp4


html:

<div class="update-info" v-if="isUpdateDate">

            更新资料>

            <button v-show="isShowUser" open-type="getUserInfo" lang="zh_CN" @click="updateDate" @getuserinfo="onGotUserInfo">更新资料</button>

          </div>

          

css:      

.update-info{

          width: 144rpx;

          height: 40rpx;

          line-height: 40rpx;

          font-size: 24rpx;

          background: #ffffff;

          border-radius: 20rpx;

          margin: 15rpx;

          opacity: 0.8;

          color: #000;

          display:inline-block;

          text-align: center;

          position: relative;

          button{

            position: absolute;

            top:0;

            left: 0;

            width: 100%;

            height:100%;

            opacity: 0;

          }

        }


最后一次编辑于  2019-04-02
回答关注问题邀请回答
收藏

3 个回答

  • 禾店短剧系统
    禾店短剧系统
    2021-06-07

    data: function () {

        return {

          msg: null,

        };

      },

    methods: {

          // 发送请求前判定

          if (!this.form.username || !this.form.password) {

            if (this.msg) {

             // 如果已经有msg实例,先清除之前的实例

             this.msg.close();

            }

            this.msg = this.$message.warning("内容不能为空");

            return;

          }

          }


    第二种方法

     methods: {

        onSubmit: function () {

          // 发送请求前判定

          if (!this.form.username || !this.form.password) {

            this.$message.closeAll();

            this.$message.warning("内容不能为空");

            return;

          }

          }

          }

    2021-06-07
    有用 1
    回复
  • Harvey
    Harvey
    2019-07-30

    有什么解决方案吗?我目前遇到相同的问题。

    2019-07-30
    有用
    回复
  • 是小白啊
    是小白啊
    2019-04-02

    视频404了,麻烦提供下代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2019-04-02
    有用
    回复 11
    查看更多(6)
登录 后发表内容