小程序P65 05.自定义组件的properties1、自定义properties属性<!--pages/home/home.wxml--><view></view><my-test1 max="9"></my-test1><!--components/test/test.wxml--><button bindtap="showInfo">showInfo</button><view>max属性的值是:{{max}}</view>// components/test/test.js properties: { //第一种:简化的方式 //max:Number //第二种:完整的定义方式max:{ type:Number, value:10 } }, methods: { //点击事件处理函数 addCount() { if(this.data.count >= this.properties.max) return this.setData({ count:this.data.count+1, max:this.properties.max+1 }) this._showCount() }, _showCount(){ wx.showToast({ title: 'count是'+this.data.count, icon:'none' }) },showInfo(){ console.log(this.data) console.log(this.properties) console.log(this.data == this.properties) } }