// components/diy-date/index.js Component({ /** * 组件的属性列表 */ properties: { txtcolor: { type: String, value: "#000000", }, txtfontsize: { type: Number, value: 32, }, txtmargin: { type: String, value: "0rpx 0rpx 0rpx 30rpx", }, datecolor: { type: String, value: "#000000", }, datefontsize: { type: Number, value: 32, }, datemargin: { type: String, value: "0rpx 30rpx 0rpx 0rpx", }, txt: { type: String, value: "日期:", }, date: { type: String, value: "2020-11-08", }, }, /** * 组件的初始数据 */ data: { /* date: '2020-11-08', */ }, /** * 组件的方法列表 */ methods: { bindDateChange: function(e) { this.triggerEvent('comclick', e.detail.value) this.setData({ date: e.detail.value }) console.log(this.data.date); }, } })