forked from opentiny/tiny-vue
fix(rate) 修复组件Rate半选加禁选后,2.5与3星实际不匹配的问题 (#200)
This commit is contained in:
parent
437d1e6177
commit
50723613fc
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<tiny-rate v-model="rate" disabled></tiny-rate>
|
||||
<tiny-rate v-model="rate" allow-half disabled></tiny-rate>
|
||||
</template>
|
||||
|
||||
<script lang="jsx">
|
||||
|
@ -11,7 +11,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
rate: 3
|
||||
rate: 2.5
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -201,7 +201,10 @@ export const computedDecimalStyle = ({ props, state }) => {
|
|||
|
||||
if (props.disabled) {
|
||||
width = `${props.modelValue * 100 - Math.floor(props.modelValue) * 100 < 50 ? 0 : 100}%`
|
||||
} else if (props.allowHalf) {
|
||||
}
|
||||
|
||||
if (props.allowHalf) {
|
||||
width = ''
|
||||
const reactSize = props.size ? Math.ceil(parseInt(props.size) / 2) + 'px' : '6px'
|
||||
|
||||
clip = `rect(0px, ${reactSize}, ${props.size || '14px'}, 0px)`
|
||||
|
|
Loading…
Reference in New Issue