zoukankan      html  css  js  c++  java
  • 小程序报错Do not have xx handler in current page的解决方法

    看到小程序这一大串的“Do not have bindName handler in current page: pages/card/card. Please make sure that bindName handler has been defined in pages/card/card, or pages/card/card has been added into app.json”

     惊不惊喜,意不意外?

    我是input输入姓名时,报的错误

     

     

    解决方法:排查

    1、是否使用page()函数注册页面

    2、添加获取值的方法

    js:

    //输入姓名
      bindName: function (e) {
        let name = e.detail.value;
        this.setData({
          usernameNew: name
        })
      },

    xml:

    <view class="items-right">
         <input bindinput="bindName" value="{{usernameNew}}" maxlength='7' placeholder-class='all-placeholder' placeholder='输入真实的姓名' class="right-print" type="text" name="usernameNew" type='text'>     
         </input>
    </view>

    3、再不济就在app.json调整文件位置

     转载本人博文时请注明出处和原文地址!!!

  • 相关阅读:
    os模块
    sys模块
    time时间模块
    collections模块
    修改Jenkins的主目录步骤
    jenkins管理
    求2个集合的差集
    MVC动态二级域名解析
    解决MVC 时间序列化的方法
    MVC修改视图的默认路径
  • 原文地址:https://www.cnblogs.com/web1/p/8930667.html
Copyright © 2011-2022 走看看