Skip to content

引入组件

局部引入

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-modelnumber当前选中的评分-
totalnumber总评分数量5
disabledboolean是否禁用评分false
sizestring自定义图标大小32rpx
colorstring自定义图标颜色#8F8D8E
activeColor string选中图标颜色#BE0909
gapstring自定义间距16rpx
allowHalfboolean是否允许半选false

事件

事件名说明回调参数
---

方法

方法名说明传入参数
---