diff --git a/examples/docs/en-US/input.md b/examples/docs/en-US/input.md index e63a776a..40c0a3d2 100644 --- a/examples/docs/en-US/input.md +++ b/examples/docs/en-US/input.md @@ -16,6 +16,7 @@ input7: '', input8: '', input9: '', + input10: '', textarea: '', textarea2: '', textarea3: '', @@ -188,6 +189,29 @@ export default { ``` ::: +### Clearable + +::: demo Make the Input clearable with the `clearable` attribute. + +```html + + + + +``` +::: + ### Input with icon Add an icon to indicate input type. @@ -639,6 +663,7 @@ Search data from server-side. |autofocus | same as `autofocus` in native input | boolean | — | false | |form | same as `form` in native input | string | — | — | | label | label text | string | — | — | +| clearable | whether to show clear button | boolean | — | false | ### Input slots diff --git a/packages/input/src/input.vue b/packages/input/src/input.vue index f530f06d..ba7aee44 100644 --- a/packages/input/src/input.vue +++ b/packages/input/src/input.vue @@ -10,7 +10,10 @@ 'el-input--prefix': $slots.prefix || prefixIcon, 'el-input--suffix': $slots.suffix || suffixIcon } - ]"> + ]" + @mouseenter="hovering = true" + @mouseleave="hovering = false" + > @@ -40,14 +43,20 @@ - - - + + + + + +