Files
doodle-mini/miniprogram/components/word-card/word-card.ts
T
2025-10-30 18:21:38 +08:00

53 lines
1.1 KiB
TypeScript

Component({
options: {
// multipleSlots: true, // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: {
key: {
type: Number,
value: 0,
},
word: {
type: String,
value: '',
},
color: {
type: String,
value: '',
},
disabledColor: {
type: Boolean,
value: false,
},
},
/**
* 组件的初始数据
*/
data: {
word: '',
color: '',
},
lifetimes: {
// attached() {
// console.log('this.data:', this.data);
// },
},
/**
* 组件的方法列表
*/
methods: {
onDelete() {
const { key, word } = this.data;
this.triggerEvent('onDelete', { key, word });
},
onColorTap() {
const { color, key, word } = this.data;
this.triggerEvent('onColorTap', { key, word, color });
},
},
});