向Object.prototype中添加方法时,方法被无穷次执行
我向Object.prototype中添加方法时,方法被无穷次执行。
就是Page({…})前写了这么一段:
Object.prototype.foo = function() {
wx.showModal({
title: ‘asdf’,
content: ‘asdf’,
})
}
在随便哪个文件的最外层写上这句,都会出问题的。
我向Object.prototype中添加方法时,方法被无穷次执行。
就是Page({…})前写了这么一段:
Object.prototype.foo = function() {
wx.showModal({
title: ‘asdf’,
content: ‘asdf’,
})
}
在随便哪个文件的最外层写上这句,都会出问题的。