[improvement] Rate: update icon (#2093)

This commit is contained in:
neverland
2018-11-15 19:34:24 +08:00
committed by GitHub
parent c02ed75e18
commit b8a74a1eef
4 changed files with 57 additions and 64 deletions

View File

@@ -3,17 +3,16 @@
:class="b()"
@touchmove="onTouchMove"
>
<svg
v-for="(isFull, index) in list"
:fill="disabled ? disabledColor : isFull ? color : voidColor"
viewBox="0 0 32 32"
:style="style"
<icon
v-for="(full, index) in list"
:key="index"
:class="b('item')"
:size="size + 'px'"
:data-index="index"
:name="full ? 'star' : 'star-o'"
:color="disabled ? disabledColor : full ? color : voidColor"
@click="onSelect(index)"
>
<path :d="isFull ? 'M32 12.408l-11.056-1.607-4.944-10.018-4.944 10.018-11.056 1.607 8 7.798-1.889 11.011 9.889-5.199 9.889 5.199-1.889-11.011 8-7.798z' : 'M32 12.408l-11.056-1.607-4.944-10.018-4.944 10.018-11.056 1.607 8 7.798-1.889 11.011 9.889-5.199 9.889 5.199-1.889-11.011 8-7.798zM16 23.547l-6.983 3.671 1.334-7.776-5.65-5.507 7.808-1.134 3.492-7.075 3.492 7.075 7.807 1.134-5.65 5.507 1.334 7.776-6.983-3.671z'" />
</svg>
/>
</div>
</template>
@@ -53,12 +52,6 @@ export default create({
},
computed: {
style() {
return {
width: this.size + 'px'
};
},
list() {
return Array.apply(null, { length: this.count }).map((value, index) => index < this.value);
}