naive-ui/demo/documentation/components/input/enUS/clearable.md
2019-10-10 14:30:36 +08:00

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;
}