This commit is contained in:
梁灏 2018-06-21 16:08:00 +08:00
parent b9ecbd5384
commit 29a2cb0c60

View file

@ -10,20 +10,16 @@
<template v-if="!showCharacter"> <template v-if="!showCharacter">
<span :class="[prefixCls + '-star-content']" type="half"></span> <span :class="[prefixCls + '-star-content']" type="half"></span>
</template> </template>
<template v-else>
<template v-if="character !== ''">
<span :class="[prefixCls + '-star-first']" type="half">{{ character }}</span>
<span :class="[prefixCls + '-star-second']">{{ character }}</span>
</template>
<template v-else> <template v-else>
<span :class="[prefixCls + '-star-first']" type="half"> <span :class="[prefixCls + '-star-first']" type="half">
<i :class="iconClasses" type="half"></i> <template v-if="character !== ''">{{ character }}</template>
<i v-else :class="iconClasses" type="half"></i>
</span> </span>
<span :class="[prefixCls + '-star-second']"> <span :class="[prefixCls + '-star-second']">
<i :class="iconClasses"></i> <template v-if="character !== ''">{{ character }}</template>
<i v-else :class="iconClasses"></i>
</span> </span>
</template> </template>
</template>
</div> </div>
<div :class="[prefixCls + '-text']" v-if="showText" v-show="currentValue > 0"> <div :class="[prefixCls + '-text']" v-if="showText" v-show="currentValue > 0">
<slot><span>{{ currentValue }}</span> <span v-if="currentValue <= 1">{{ t('i.rate.star') }}</span><span v-else>{{ t('i.rate.stars') }}</span></slot> <slot><span>{{ currentValue }}</span> <span v-if="currentValue <= 1">{{ t('i.rate.star') }}</span><span v-else>{{ t('i.rate.stars') }}</span></slot>