Skip to content

Commit a6c29ff

Browse files
author
xueyuan
committed
feat(input/docs): 添加en-US新的输入示例和选择全部功能
1 parent 2a36f9e commit a6c29ff

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

  • packages/varlet-ui/src/input/docs

packages/varlet-ui/src/input/docs/en-US.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ const value11 = ref('')
2525
const value12 = ref('')
2626
const value13 = ref('')
2727
const value14 = ref('')
28+
const value15 = ref('')
29+
const value16 = ref('')
30+
const inputRef = ref()
31+
32+
const selectAll = () => {
33+
inputRef.value?.select()
34+
}
2835
</script>
2936
3037
<template>
@@ -69,6 +76,19 @@ const value14 = ref('')
6976
<var-input placeholder="Textarea" textarea v-model="value10" />
7077
<var-input placeholder="Small Size" size="small" v-model="value11" />
7178
<var-input placeholder="Removes whitespace from both ends of this string" v-model.trim="value12" />
79+
<var-input
80+
placeholder="Try pressing Enter"
81+
v-model="value15"
82+
@enter="() => {}"
83+
/>
84+
<var-space>
85+
<var-input
86+
ref="inputRef"
87+
placeholder="Enter text and click the button to select all"
88+
v-model="value16"
89+
/>
90+
<var-button type="primary" @click="selectAll">Select All</var-button>
91+
</var-space>
7292
</var-space>
7393
</template>
7494
@@ -104,6 +124,13 @@ const value11 = ref('')
104124
const value12 = ref('')
105125
const value13 = ref('')
106126
const value14 = ref('')
127+
const value15 = ref('')
128+
const value16 = ref('')
129+
const inputRef = ref()
130+
131+
const selectAll = () => {
132+
inputRef.value?.select()
133+
}
107134
</script>
108135
109136
<template>
@@ -154,6 +181,19 @@ const value14 = ref('')
154181
<var-input variant="outlined" placeholder="Textarea" textarea v-model="value10" />
155182
<var-input variant="outlined" placeholder="Small Size" size="small" v-model="value11" />
156183
<var-input variant="outlined" placeholder="Removes whitespace from both ends of this string" v-model.trim="value12" />
184+
<var-input
185+
placeholder="Try pressing Enter"
186+
v-model="value15"
187+
@enter="() => {}"
188+
/>
189+
<var-space>
190+
<var-input
191+
ref="inputRef"
192+
placeholder="Enter text and click the button to select all"
193+
v-model="value16"
194+
/>
195+
<var-button type="primary" @click="selectAll">Select All</var-button>
196+
</var-space>
157197
</var-space>
158198
</template>
159199

0 commit comments

Comments
 (0)