| 123456789101112131415161718192021222324252627282930 | Component({  properties: {    title: {      type: String    },    type: {      type: String,      value: "default", //默认类型 switch-开关    },    switchLabel: {      type: String    }, //开关标签,type==switch生效    switch: {      type: Boolean    }, //开关属性值,type==switch生效    callBack: {      type: Function    }  },  methods: {    /* 改变开关状态 */    changeSwitch() {      let showAll = !this.data.switch;      this.setData({        switch: showAll      })      this.triggerEvent("callBack", showAll)    }  }})
 |