【发布时间】:2018-03-30 06:14:39
【问题描述】:
我的用例是这样的,
- 我从后端获得了星级作为数字(1,2,3,4,5)。
- 如果它是 3 号,我想将前 3 颗星涂成黄色,然后将其扩孔为默认颜色。 如何使用 Vue JS 实现这一目标?
这是我的代码。
<template>
<div id="app">
<span class="demo">★★★★★</span>
</div>
</template>
<script>
export default {
name: 'app',
data () {
return {
}
},
methods:{
}
}
</script>
<style>
.demo{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
font-size: 6em;
color:yellow;
text-shadow: 0 0 15px blue;
}
</style>
【问题讨论】: