input 输入框 第二次失去焦点时会报错
发布于 5 年前 作者 chao53 17981 次浏览 来自 问答

input 输入框 当value 为空的时候 失去焦点 第一次不报错 当再次触发 失去焦点 不管value是不是为空都会报错!

哪位大神 能给解决下!

小弟刚开始接触,不太懂!

报错代码:

thirdScriptError

this[n].apply is not a function;at “pages/component/second/index” page userName function

TypeError: this[n].apply is not a function

    at e.a (http://70502904.appservice.open.weixin.qq.com/WAService.js:8:27066)

    at R (http://70502904.appservice.open.weixin.qq.com/WAService.js:8:22530)

    at .<anonymous> (http://70502904.appservice.open.weixin.qq.com/WAService.js:8:23963)

    at http://70502904.appservice.open.weixin.qq.com/WAService.js:8:28571

    at http://70502904.appservice.open.weixin.qq.com/WAService.js:4:4856

    at Object.e.(anonymous function) [as PAGE_EVENT] (http://70502904.appservice.open.weixin.qq.com/WAService.js:4:18109)

    at n.<anonymous> (http://70502904.appservice.open.weixin.qq.com/asdebug.js:1:13708)

    at n.emit (http://70502904.appservice.open.weixin.qq.com/asdebug.js:1:8747)

    at r (http://70502904.appservice.open.weixin.qq.com/asdebug.js:1:1385)

    at http://70502904.appservice.open.weixin.qq.com/asdebug.js:1:4867errorReport @ WAService.js:3thirdErrorReport @ WAService.js:3(anonymous function) @ WAService.js:3a @ WAService.js:8R @ WAService.js:8(anonymous function) @ WAService.js:8(anonymous function) @ WAService.js:8(anonymous function) @ WAService.js:4e.(anonymous function) @ WAService.js:4(anonymous function) @ asdebug.js:1n.emit @ asdebug.js:1r @ asdebug.js:1(anonymous function) @ asdebug.js:1g @ asdebug.js:1(anonymous function) @ asdebug.js:1

相关源码

html <input type=“text” placeholder=“会员姓名” bindblur=“userName” />

js

userName:function(e){

      this.userName = e.detail.value;

  }

变量都已经声明过了

回到顶部