const app = getApp(); Component({ properties: { course_id: Number, id_: Number, course_identity:Number, refresh: { type: Number, observer: function (r) { if (r) { console.log("observer refresh") this.refresh(); this.setData({ refresh: false }); } } } }, data: { }, attached(){ this.refresh(); }, pageLifetimes: { show: function () { this.refresh(); } }, methods: { onChoose(e){ console.log(e); }, refresh(){ let {course_id,course_identity} = this.data; app.api("weapps.courses.teachers")({course_id,limit:1000}).then(res=>{ console.log(res); let {teacher_list, teacher_list_size, apply_size} = res; this.setData({teacher_list, teacher_list_size, apply_size}); }) let ext = {course_id, course_identity}; this.setData({ext}); } } })