各位大佬,我在pages页面增加components之后,显示页显示不出来变量信息了,而且按键也都无效了,不增加之前这些问题都是不存在的,麻烦问下怎么回事啊,谢谢
components js代码如下:
Component({
data: {
text: '请勿外传',
color: 'rgba(0,0,0,0.1)',
rows: [],
cols: []
},
attached() {
const { windowWidth, windowHeight } = wx.getSystemInfoSync();
const rows = Math.ceil(windowWidth / (40 * this.data.text.length));
const cols = Math.ceil(windowHeight / 120);
const waterMark=wx.getStorageSync('waterMark')
this.setData({
rows: new Array(rows),
cols: new Array(cols)
});
},
})