|
|
@ -1,13 +1,15 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
基本
|
|
|
|
基本
|
|
|
|
<Rate className="custom"></Rate>
|
|
|
|
<Rate className="custom" :allowHalf="allowHalf"></Rate>
|
|
|
|
</br>
|
|
|
|
</br>
|
|
|
|
半星
|
|
|
|
半星
|
|
|
|
<Rate :allowHalf="allowHalf"></Rate>
|
|
|
|
<Rate :allowHalf="allowHalf"></Rate>
|
|
|
|
</br>
|
|
|
|
</br>
|
|
|
|
默认3颗星
|
|
|
|
默认3颗星
|
|
|
|
<Rate :value="initValue"></Rate>
|
|
|
|
<Rate v-model="initValue"></Rate>
|
|
|
|
|
|
|
|
<AntButton type="primary" @click="changeValue">改变</AntButton>
|
|
|
|
|
|
|
|
<AntButton type="primary" @click="getValue">当前值</AntButton>
|
|
|
|
</br>
|
|
|
|
</br>
|
|
|
|
只读
|
|
|
|
只读
|
|
|
|
<Rate :value="initValue" :disabled="disabled"></Rate>
|
|
|
|
<Rate :value="initValue" :disabled="disabled"></Rate>
|
|
|
@ -25,15 +27,11 @@
|
|
|
|
<span v-if="hoverValueAH">{{hoverValueAH}}stars</span>
|
|
|
|
<span v-if="hoverValueAH">{{hoverValueAH}}stars</span>
|
|
|
|
</br>
|
|
|
|
</br>
|
|
|
|
自定义
|
|
|
|
自定义
|
|
|
|
<Rate :value="initValue">
|
|
|
|
<Rate :value="initValue" :character="character"></Rate>
|
|
|
|
<template slot-scope="props">
|
|
|
|
|
|
|
|
<span>A</span>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</Rate>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { Rate } from '../components/index'
|
|
|
|
import { Rate, Icon, Button } from '../components/index'
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data () {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -43,6 +41,7 @@ export default {
|
|
|
|
hoverValue: undefined,
|
|
|
|
hoverValue: undefined,
|
|
|
|
rValue: undefined,
|
|
|
|
rValue: undefined,
|
|
|
|
hoverValueAH: undefined,
|
|
|
|
hoverValueAH: undefined,
|
|
|
|
|
|
|
|
character: '好'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
@ -54,10 +53,18 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onHoverChangeAH(val) {
|
|
|
|
onHoverChangeAH(val) {
|
|
|
|
this.hoverValueAH = val;
|
|
|
|
this.hoverValueAH = val;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
changeValue() {
|
|
|
|
|
|
|
|
this.initValue = 4;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getValue() {
|
|
|
|
|
|
|
|
alert(this.initValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
Rate
|
|
|
|
Rate,
|
|
|
|
|
|
|
|
Icon,
|
|
|
|
|
|
|
|
AntButton: Button,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|