Skip to content

Commit

Permalink
feat(Rate): add prop iconClass
Browse files Browse the repository at this point in the history
  • Loading branch information
vvpvvp committed Jul 29, 2019
1 parent 94e98c6 commit d6b4d44
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions doc/components/component/rate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@
<td>-</td>
<td>false</td>
</tr>
<tr>
<td>iconClass</td>
<td></td>
<td>String</td>
<td>-</td>
<td>h-icon-star-on</td>
</tr>
</table>

<h3>Rate 事件</h3>
Expand Down
4 changes: 3 additions & 1 deletion doc/components/demos/form/rate1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div>
<p><Rate v-model="value1"></Rate></p>
<p><Rate v-model="value2" show-text></Rate></p>
<p><Rate v-model="value3" iconClass="h-icon-complete"></Rate></p>
</div>
</template>

Expand All @@ -11,7 +12,8 @@ export default {
data() {
return {
value1: 2,
value2: 2.3
value2: 2.3,
value3: 1
};
}
};
Expand Down
7 changes: 7 additions & 0 deletions doc/components_en/component/rate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@
<td>-</td>
<td>false</td>
</tr>
<tr>
<td>iconClass</td>
<td></td>
<td>String</td>
<td>-</td>
<td>h-icon-star-on</td>
</tr>
</table>

<h3>Rate Event</h3>
Expand Down
6 changes: 5 additions & 1 deletion src/components/rate/rate.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="h-rate" :readonly="readonly" @mouseleave="mouseleave()"><span v-for="n in 5" :key="n" @click="setvalue(n)" :class="starCls(n)" @mouseover="mouseover(n)"><i class="h-icon-star-on"></i></span><span v-if="showText" class="h-rate-value">{{value}}</span></div>
<div class="h-rate" :readonly="readonly" @mouseleave="mouseleave()"><span v-for="n in 5" :key="n" @click="setvalue(n)" :class="starCls(n)" @mouseover="mouseover(n)"><i :class="iconClass"></i></span><span v-if="showText" class="h-rate-value">{{value}}</span></div>
</template>
<script>
export default {
Expand All @@ -13,6 +13,10 @@ export default {
type: Boolean,
default: false
},
iconClass: {
type: String,
default: 'h-icon-star-on'
},
value: {
type: [String, Number],
default: 0
Expand Down

0 comments on commit d6b4d44

Please sign in to comment.