feat: 完成文字涂色卡功能

This commit is contained in:
2025-07-01 11:27:50 +08:00
parent 654afced6f
commit 6d38a17652
21 changed files with 267 additions and 103 deletions
@@ -18,20 +18,28 @@ Component({
/**
* 组件的初始数据
*/
data: {},
data: {
},
lifetimes: {
attached() {
(this as any).words = '';
(this as any).value = '';
},
},
/**
* 组件的方法列表
*/
methods: {
onConfirm(e: WechatMiniprogram.Input) {
onInput(e: WechatMiniprogram.Input) {
let { value } = e.detail;
// (this as any).words = value;
value = value.replace(' ', '');
value = value.replace(/\s/g, '');
if (value.length > 0) {
(this as any).value = value;
}
},
onConfirm() {
const value = (this as any).value;
if (value.length > 0) {
this.triggerEvent('onConfirm', { value });
}