diff --git a/src/components/rate/rate.vue b/src/components/rate/rate.vue index 78543d7e..6d611ceb 100644 --- a/src/components/rate/rate.vue +++ b/src/components/rate/rate.vue @@ -48,15 +48,9 @@ hoverIndex: -1, isHover: false, isHalf: false, - currentValue: 0 + currentValue: this.value }; }, - // created () { - // this.currentValue = this.value; - // this.setHalf(this.currentValue); - // }, - mounted () { - }, computed: { classes () { return [ @@ -68,26 +62,12 @@ } }, watch: { - value: { - immediate: true, - handler (val) { - this.currentValue = val; - } + value (val) { + this.currentValue = val; }, - // valur (val) { - // console.log(val); - // this.currentValue = val; - // console.log(this.currentValue); - // }, - currentValue: { - immediate: true, - handler () { - this.setHalf(this.currentValue); - } + currentValue (val) { + this.setHalf(val); } - // currentValue () { - // this.setHalf(this.currentValue); - // } }, methods: { starCls (value) { @@ -138,13 +118,13 @@ }, handleClick (value) { if (this.disabled) return; - // value++; +// value++; if (this.isHalf) value -= 0.5; this.currentValue = value; - this.$emit('on-change', this.currentValue); - this.$emit('input', this.currentValue); + this.$emit('input', value); + this.$emit('on-change', value); // @todo - // this.$dispatch('on-form-change', value); +// this.$dispatch('on-form-change', value); } } }; diff --git a/src/components/tree/tree.vue b/src/components/tree/tree.vue index 67f7ad98..6e78eb8e 100644 --- a/src/components/tree/tree.vue +++ b/src/components/tree/tree.vue @@ -30,14 +30,14 @@ import Icon from '../icon/icon.vue'; import Checkbox from '../checkbox/checkbox.vue'; import { t } from '../../locale'; - import emitter from '../../mixins/emitter'; + import Emitter from '../../mixins/emitter'; const prefixCls = 'ivu-tree'; export default { name: 'Tree', components: { Icon, Checkbox }, - mixins: [ emitter ], + mixins: [ Emitter ], props: { value: { type: Array, diff --git a/test/routers/rate.vue b/test/routers/rate.vue index 8139f8a2..0584f61e 100644 --- a/test/routers/rate.vue +++ b/test/routers/rate.vue @@ -1,30 +1,18 @@