37 lines
719 B
TypeScript
37 lines
719 B
TypeScript
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
key: {
|
|
type: Number,
|
|
value: 0,
|
|
},
|
|
img: {
|
|
type: String,
|
|
value: '',
|
|
},
|
|
name: {
|
|
type: String,
|
|
value: '',
|
|
},
|
|
color: {
|
|
type: String,
|
|
value: '',
|
|
},
|
|
},
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
methods: {
|
|
onDelete() {
|
|
const { key } = this.data;
|
|
this.triggerEvent('onDelete', { key });
|
|
},
|
|
onColorTap() {
|
|
const { key, color } = this.data;
|
|
this.triggerEvent('onColorTap', { key, color });
|
|
},
|
|
},
|
|
});
|