在我的 main.js 中,我有:
import listeners from "./listeners"
listeners.call(this)
我的listeners.js
是:
import _ from "lodash"
const listeners = () => {
console.log("this", this)
}
export default listeners
当它运行时,它在 listeners
函数中没有正确的 this
值。我做错了什么?
最佳答案
关于javascript - 如何设置函数的 this 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44192339/