很簡單:
比如在 onLoad () {
imgRemove(e) {
this
.methods.onRemove(e)
}
}
在methods中就可以直接調用屬於它的方法,主要是一個屬性查找問題,屬於哪個元素下的方法
methods = {
onRemove(e) {
console.log("--"+ e +"--"
)
}
onAlert() {
this.onRemove()
}
}