// packageE/others/case_library/mycomponents/subject_mobile.js Component({ /** * 组件的属性列表 */ properties: { datas: { type: null, }, }, lifetimes: { // 生命周期函数,可以为函数,或一个在methods段中定义的方法名 attached() { console.log(this.properties.datas); }, moved() {}, detached() {}, }, observers: { datas: function (kid) { // 在 numberA 或者 numberB 被设置时,执行这个函数 console.log(kid, "11112"); this.setData({ list: kid, }); }, }, /** * 组件的初始数据 */ data: { list: [], }, /** * 组件的方法列表 */ methods: { gotoDetail(e) { console.log(e); let id = e.currentTarget.dataset.id; wx.navigateTo({ url: "/packageE/others/case_library/subject_detail/caseLibrarySubjectDetail?id=" + id, }); }, }, });