setData函数怎么用啊?
const app = getApp()
Page({
data: {
t: [
‘…/img/00.jpg’,
‘…/img/01.jpg’,
]
}
})
……
onLoad: function () {
t: [
'../img/03.jpg',
'../img/04.jpg',
]
var temp = t;
this.setData({
t: temp
})
}
运行后老是提示以下错误:
WAService.js:3 thirdScriptError
t is not defined;at pages/index/index page lifeCycleMethod onLoad function
ReferenceError: t is not defined
……
搞这个函数搞了一个多星期了,都弄不明白,请哪位高手赐教!不胜感激!