diff --git a/packages/varlet-ui/src/input/example/index.vue b/packages/varlet-ui/src/input/example/index.vue index 1005492acc5..88e5e2e2eff 100644 --- a/packages/varlet-ui/src/input/example/index.vue +++ b/packages/varlet-ui/src/input/example/index.vue @@ -41,7 +41,7 @@ import Input from '..' import Button from '../../button' import Icon from '../../icon' import AppType from '@varlet/cli/site/mobile/components/AppType' -import { ref } from 'vue' +import { ref, watch } from 'vue' import { use, pack } from './locale' import { watchLang } from '../../utils/components' @@ -57,14 +57,18 @@ export default { const value = ref('') const value2 = ref('') const value3 = ref('') - const value4 = ref('这段话无法被用户修改') - const value5 = ref('这段话可以被直接清除') + const value4 = ref('') + const value5 = ref('') const value6 = ref('') const value7 = ref('') const value8 = ref('') const value9 = ref('') - watchLang(use) + watchLang((lang) => { + use(lang) + value4.value = pack.value.readonlyText + value5.value = pack.value.clearableText + }) return { pack, diff --git a/packages/varlet-ui/src/input/example/locale/en-US.ts b/packages/varlet-ui/src/input/example/locale/en-US.ts index 8c748de964d..e06b8fa16c4 100644 --- a/packages/varlet-ui/src/input/example/locale/en-US.ts +++ b/packages/varlet-ui/src/input/example/locale/en-US.ts @@ -10,4 +10,6 @@ export default { validate: 'Validate', placeholder: 'Please enter text', maxMessage: 'Text length must be greater than 6', + readonlyText: 'Readonly Text', + clearableText: 'Clearable Text', } diff --git a/packages/varlet-ui/src/input/example/locale/zh-CN.ts b/packages/varlet-ui/src/input/example/locale/zh-CN.ts index 4227ed1b2e3..6610278518e 100644 --- a/packages/varlet-ui/src/input/example/locale/zh-CN.ts +++ b/packages/varlet-ui/src/input/example/locale/zh-CN.ts @@ -10,4 +10,6 @@ export default { validate: '字段校验', placeholder: '请输入文本', maxMessage: '文本长度必须大于6', + readonlyText: '只读文本', + clearableText: '可清除文本', }