Skip to content

Commit 820703a

Browse files
author
申蛟隆
committed
jsTag
1 parent 5b2787a commit 820703a

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed
Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1-
export default () => {
2-
return {}
1+
export default (tabSize: string) => {
2+
return {
3+
"a-rules:required": `{ required: true, message: '$1', trigger: 'change' }`,
4+
"a-rules:max": `{ min: 3, max: 5, message: '$1', trigger: 'blur' }`,
5+
"a-form:resetForm": `const resetForm = () => {
6+
${tabSize}formRef.value.resetFields();
7+
};`,
8+
"a-form:submit": `const onSubmit = () => {
9+
${tabSize}formRef.value
10+
${tabSize}.validate()
11+
${tabSize}.then(() => {
12+
${tabSize}${tabSize}console.log('values', formState, toRaw(formState));
13+
${tabSize}})
14+
${tabSize}.catch(error => {
15+
${tabSize}${tabSize}console.log('error', error);
16+
${tabSize}});
17+
};`,
18+
"a-message:info": `message.info('$1')`,
19+
"a-message:success": `message.success('$1')`,
20+
"a-message:error": `message.error('$1')`,
21+
"a-message:warning": `message.warning('$1')`,
22+
"a-notification:success": `notification.success({
23+
${tabSize}message: '$1',
24+
${tabSize}description: '$2',
25+
})`,
26+
"a-notification:info": `notification.info({
27+
${tabSize}message: '$1',
28+
${tabSize}description: '$2',
29+
})`,
30+
"a-notification:error": `notification.error({
31+
${tabSize}message: '$1',
32+
${tabSize}description: '$2',
33+
})`,
34+
"a-notification:warning": `notification.warning({
35+
${tabSize}message: '$1',
36+
${tabSize}description: '$2',
37+
})`,
38+
}
339
}

0 commit comments

Comments
 (0)