html52.com
我爱小程序-开发者交流社区

为什么我的this拿到的都是window方法

问题模块
API和组件

如图 我 console.log(this) 出来一直都是一个window

如图 我 console.log(this) 出来一直都是一个window

网友回复

maq:

好神奇……

Baran:

checkNull 方法里输出 this 一直都是一个 window

Baran:

wxml部分

<input type="text" password name="password" placeholder="输入原始密码" focus bindblur="checkNull"/>


js 部分

checkNull: (e) => {

    const that = this

    e.detail.value && that.setData({

      disabled: false

    })

  },


王宁宁:

你好,请贴上相关代码

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付