mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-27 05:00:48 +08:00
573 B
573 B
Clearable
Make input clearable when value is set.
<n-input
v-model="value"
type="input"
placeholder="Content is clearable"
clearable
/>
<n-input
v-model="value"
type="password"
placeholder="Content is clearable"
clearable
/>
<n-input
v-model="value"
type="textarea"
placeholder="Content is clearable"
round
clearable
/>
<n-button size="small" @click="value = 'Content is clearable'">Fill Content</n-button>
export default {
data() {
return {
value: null
}
}
}
.n-input {
margin-bottom: 8px;
}