// pages/common/foot/teacher/foot.js Component({ properties: { dataInd: { type: String, value: '' } }, data: { tabList: [{ icon: 'iconfont icon-shouye', txt: "้ฆ–้กต", url: '/pages/main/main', id: '0', color: '' }, { icon: 'iconfont icon-wode', txt: "ๆˆ‘็š„", url: '/pages/mine/mine', id: '2', color: '' } ] }, ready() { this.properties.tabList.map(file => { if (file.id == this.properties.dataInd) { file.color = '#0ac4ff' } }) this.setData({ tabList: this.properties.tabList }) } })