feat: 完成文字涂色卡功能
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user