mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(components): [rate] add clearable attribute (#10031)
feat(components): [rate] add clearable attribute
This commit is contained in:
@@ -41,6 +41,14 @@ rate/text
|
||||
|
||||
:::
|
||||
|
||||
## Clearable
|
||||
|
||||
:::demo You can reset the value to `0` when you click at the same value again.
|
||||
|
||||
rate/clearable
|
||||
|
||||
:::
|
||||
|
||||
## More icons
|
||||
|
||||
You can use different icons to distinguish different rate components.
|
||||
@@ -97,6 +105,7 @@ Use `css/scss` language to change the global or local color. We set some global
|
||||
| text-color | color of texts | string | — | #1F2D3D |
|
||||
| texts | text array | array | — | ['Extremely bad', 'Disappointed', 'Fair', 'Satisfied', 'Surprise'] |
|
||||
| score-template | score template | string | — | {value} |
|
||||
| clearable | whether value can be reset to `0` | boolean | — | false |
|
||||
|
||||
## Events
|
||||
|
||||
|
||||
9
docs/examples/rate/clearable.vue
Normal file
9
docs/examples/rate/clearable.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<el-rate v-model="value" clearable />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
const value = ref(3)
|
||||
</script>
|
||||
Reference in New Issue
Block a user