feat(Field): add format-trigger prop (#6566)
This commit is contained in:
@@ -1,10 +1,17 @@
|
||||
<template>
|
||||
<demo-block v-if="!isWeapp" :title="t('formatValue')">
|
||||
<van-field
|
||||
v-model="formatValue"
|
||||
v-model="value1"
|
||||
:label="t('text')"
|
||||
:formatter="formatter"
|
||||
:placeholder="t('formatValue')"
|
||||
:placeholder="t('formatOnChange')"
|
||||
/>
|
||||
<van-field
|
||||
v-model="value2"
|
||||
:label="t('text')"
|
||||
:formatter="formatter"
|
||||
format-trigger="onBlur"
|
||||
:placeholder="t('formatOnBlur')"
|
||||
/>
|
||||
</demo-block>
|
||||
</template>
|
||||
@@ -15,16 +22,21 @@ export default {
|
||||
'zh-CN': {
|
||||
text: '文本',
|
||||
formatValue: '格式化输入内容',
|
||||
formatOnBlur: '在失焦时执行格式化',
|
||||
formatOnChange: '在输入时执行格式化',
|
||||
},
|
||||
'en-US': {
|
||||
text: 'Text',
|
||||
formatValue: 'Format Value',
|
||||
formatOnBlur: 'Format On Blur',
|
||||
formatOnChange: 'Format On Change',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
formatValue: '',
|
||||
value1: '',
|
||||
value2: '',
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user