File tree Expand file tree Collapse file tree
packages/varlet-ui/src/input/docs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,13 @@ const value11 = ref('')
2525const value12 = ref (' ' )
2626const value13 = ref (' ' )
2727const 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('')
104124const value12 = ref (' ' )
105125const value13 = ref (' ' )
106126const 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
You can’t perform that action at this time.
0 commit comments