feat(components): [rate] add clearable attribute (#10031)

feat(components): [rate] add clearable attribute
This commit is contained in:
Hefty
2022-10-11 10:21:19 +08:00
committed by GitHub
parent 0efa33f3c4
commit 31f713bf1b
5 changed files with 59 additions and 8 deletions

View File

@@ -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

View 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>