docs(Field): split demo

This commit is contained in:
陈嘉涵
2020-02-03 11:56:57 +08:00
parent 69560f4fce
commit 143bd4297f
13 changed files with 452 additions and 253 deletions
+39
View File
@@ -0,0 +1,39 @@
<template>
<demo-block v-if="!isWeapp" :title="$t('formatValue')">
<van-cell-group>
<van-field
v-model="formatValue"
:label="$t('text')"
:formatter="formatter"
:placeholder="$t('formatValue')"
/>
</van-cell-group>
</demo-block>
</template>
<script>
export default {
i18n: {
'zh-CN': {
text: '文本',
formatValue: '格式化输入内容',
},
'en-US': {
text: 'Text',
formatValue: 'Format Value',
},
},
data() {
return {
formatValue: '',
};
},
methods: {
formatter(value) {
return value.replace(/\d/g, '');
},
},
};
</script>