layui/example/docs/zh-CN/components/rate.md

149 lines
1.7 KiB
Markdown
Raw Normal View History

2021-10-25 17:13:23 +00:00
::: title 基础使用
2021-10-19 14:28:44 +00:00
:::
2021-10-04 00:06:19 +00:00
::: demo
<template>
2021-11-07 07:55:08 +00:00
<lay-rate v-model="all1"></lay-rate>
2021-10-04 00:06:19 +00:00
</template>
<script>
import { ref } from 'vue';
2021-10-04 00:06:19 +00:00
export default {
setup() {
2021-11-07 07:55:08 +00:00
const all1 = ref(0)
2021-10-04 00:06:19 +00:00
return {
2021-11-07 07:55:08 +00:00
all1
2021-10-04 00:06:19 +00:00
}
}
}
</script>
2021-10-08 07:42:14 +00:00
:::
2021-10-25 17:13:23 +00:00
::: title 响应结果
2021-10-19 14:28:44 +00:00
:::
2021-10-08 07:42:14 +00:00
::: demo
<template>
<lay-rate v-model="all"></lay-rate> {{all}}
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const all = ref(4)
return {
all
}
}
}
</script>
:::
2021-10-25 17:13:23 +00:00
::: title 指定长度
2021-10-19 14:28:44 +00:00
:::
2021-10-08 07:42:14 +00:00
::: demo
<template>
2021-10-26 18:04:47 +00:00
<lay-rate v-model="all2" :length="length"></lay-rate>
2021-10-08 07:42:14 +00:00
</template>
<script>
import { ref } from 'vue';
2021-10-08 07:42:14 +00:00
export default {
setup() {
const all2 = ref(4);
2021-10-15 06:27:58 +00:00
const length = ref(10)
2021-10-08 07:42:14 +00:00
return {
2021-10-15 06:27:58 +00:00
all2,
length
2021-10-08 07:42:14 +00:00
}
}
}
</script>
:::
2021-10-26 18:04:47 +00:00
::: title 只读模式
:::
::: demo
<template>
<lay-rate v-model="all3" readonly="true"></lay-rate>
</template>
<script>
import { ref } from 'vue';
export default {
setup() {
const all3 = ref(4)
return {
all3
}
}
}
</script>
:::
::: title 定义主题
:::
::: demo
<template>
<lay-rate v-model="all4" theme="#FF8000"></lay-rate><br>
<lay-rate v-model="all4" theme="#009688"></lay-rate><br>
<lay-rate v-model="all4" theme="#1E9FFF"></lay-rate><br>
<lay-rate v-model="all4" theme="#2F4056"></lay-rate><br>
<lay-rate v-model="all4" theme="#FE0000"></lay-rate><br>
</template>
<script>
import { ref } from 'vue';
export default {
setup() {
const all4 = ref(4)
return {
all4
}
}
}
</script>
:::
2021-10-25 17:13:23 +00:00
::: title 评分属性
:::
2021-10-12 10:00:09 +00:00
2021-11-07 07:55:08 +00:00
::: table
| 属性 | 描述 | 默认值 |
| -------- | -------- | ------ |
| v-model | 评分值 | -- |
| length | 评分长度 | -- |
| readonly | 只读模式 | -- |
2021-11-07 07:55:08 +00:00
2021-11-07 07:56:24 +00:00
:::