// pages/login/modules/agreement.js Component({ /** * 组件的属性列表 */ properties: { isAgree: { type: Boolean }, callBack: { type: Function } }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { /* 修改授权 */ isAgreeChange() { let isAgree = !this.data.isAgree this.setData({ isAgree }) this.triggerEvent("callBack", isAgree) } } })