Appearance
引入组件
局部引入
ts
// parent.vue
const FRate = defineAsyncComponent(() => import('@/components/formaui/f-rate/f-rate.vue'))基础用法
html
<view class="font-semibold py-3">基础使用</view>
<f-rate v-model="active"></f-rate>
<view class="font-semibold py-3">自定义大小</view>
<f-rate v-model="active" size="48rpx"></f-rate>
<view class="font-semibold py-3">自定义颜色</view>
<f-rate v-model="active" active-color="#FFD700"></f-rate>
<view class="font-semibold py-3">半选</view>
<f-rate :modelValue="3.5" disabled allow-half></f-rate>ts
import { ref } from 'vue'
const active = ref<number>(3)插槽
| 名称 | 说明 |
|---|---|
| default | 键盘上方展示的内容 |
属性
| 名称 | 类型 | 说明 | 默认值 |
|---|---|---|---|
v-model | number | 当前选中的评分 | - |
total | number | 总评分数量 | 5 |
disabled | boolean | 是否禁用评分 | false |
size | string | 自定义图标大小 | 32rpx |
color | string | 自定义图标颜色 | #8F8D8E |
activeColor | string | 选中图标颜色 | #BE0909 |
gap | string | 自定义间距 | 16rpx |
allowHalf | boolean | 是否允许半选 | false |
事件
| 事件名 | 说明 | 回调参数 |
|---|---|---|
| - | - | - |
方法
| 方法名 | 说明 | 传入参数 |
|---|---|---|
| - | - | - |
