feat:练字贴功能基本完成

This commit is contained in:
R524809
2025-10-30 18:21:38 +08:00
parent c4f27f2125
commit 2e0f8f0fe1
19 changed files with 450 additions and 564 deletions
@@ -10,6 +10,10 @@ Component({
type: Boolean,
value: false,
},
cardList: {
type: Array,
value: [],
},
currentTab: {
type: Number,
value: 0,
@@ -31,14 +35,20 @@ Component({
},
lifetimes: {
ready() {
// 初始化同步一次 selectedWords,避免首次传入时未触发 observers 的情况
const list = (this.data as any).cardList || [];
if (Array.isArray(list) && list.length > 0) {
const selectedWords = list.map((item: any) => item.word);
this.setData({ selectedWords });
}
},
},
/* observers: {
observers: {
cardList(newVal: CardList) {
const selectedWords = newVal.map((item) => item.word);
this.setData({ selectedWords });
},
}, */
},
/**
* 组件的方法列表
*/