为什么我的this拿到的都是window方法
发布于 5 年前 作者 qiang76 10276 次浏览 来自 问答

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

4 回复

wxml部分

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

js 部分

checkNull: (e) => {

    const that = this

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

      disabled: false

    })

  },

好神奇……

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

你好,请贴上相关代码

回到顶部