update Rate
update Rate @huixisheng
This commit is contained in:
parent
743d027897
commit
e2c6ff2b67
3 changed files with 19 additions and 51 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue