当前位置: 移动技术网 > IT编程>开发语言>JavaScript > 小程序报错Do not have xx handler in current page的解决方法

小程序报错Do not have xx handler in current page的解决方法

2018年04月25日  | 移动技术网IT编程  | 我要评论

看到小程序这一大串的“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调整文件位置

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网