Merge branch 'next' of https://gitee.com/layui/layui-vue into next

This commit is contained in:
就眠儀式 2022-07-18 14:50:32 +08:00
commit f37d9c3f0c
2 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ export interface LayRateProps {
half?: boolean;
text?: boolean;
isBlock?: boolean;
hasClear?: boolean;
allowClear?: boolean;
clearIcon?: string;
icons?: string[];
}
@ -28,7 +28,7 @@ const props = withDefaults(defineProps<LayRateProps>(), {
half: false,
text: false,
isBlock: false,
hasClear: false,
allowClear: false,
clearIcon: "layui-icon-close-fill",
icons: () => [
"layui-icon-rate",
@ -83,7 +83,7 @@ const action = function (index: number, event: any) {
};
//
const showClearIcon = computed(() => !props.readonly && props.hasClear);
const showClearIcon = computed(() => !props.readonly && props.allowClear);
const clearRate = function () {
tempValue.value = 0;
currentValue.value = 0;

View File

@ -95,7 +95,7 @@ export default {
::: demo
<template>
<lay-rate v-model="clearHalf" :half="true" :is-block="true" has-clear></lay-rate>
<lay-rate v-model="clearHalf" :half="true" :is-block="true" allow-clear></lay-rate>
</template>
<script>
@ -313,7 +313,7 @@ export default {
| half | 设定组件是否可以选择半星 | `boolean` | false |
| text | 是否显示评分对应的内容 | `boolean` | false |
| is-block | 评分是否显示为快元素 | `boolean` | false |
| has-clear | 评分是否需要清除功能 | `boolean` | false |
| allow-clear | 评分是否需要清除功能 | `boolean` | false |
| clear-icon | 评分清除功能使用的图标`class` | `string` | `layui-icon-close-fill` |
| icons | 评分使用图标`class``["空心", "实心"]`/`["空心", "半心", "实心"]` | `string[]` | 星型 |