Rate support Form's disabled
This commit is contained in:
parent
4df3007a56
commit
570b9e7132
1 changed files with 6 additions and 5 deletions
|
@ -29,6 +29,7 @@
|
||||||
<script>
|
<script>
|
||||||
import Locale from '../../mixins/locale';
|
import Locale from '../../mixins/locale';
|
||||||
import Emitter from '../../mixins/emitter';
|
import Emitter from '../../mixins/emitter';
|
||||||
|
import mixinsForm from '../../mixins/form';
|
||||||
|
|
||||||
import Icon from '../icon/icon.vue';
|
import Icon from '../icon/icon.vue';
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Rate',
|
name: 'Rate',
|
||||||
mixins: [ Locale, Emitter ],
|
mixins: [ Locale, Emitter, mixinsForm ],
|
||||||
components: { Icon },
|
components: { Icon },
|
||||||
props: {
|
props: {
|
||||||
count: {
|
count: {
|
||||||
|
@ -93,7 +94,7 @@
|
||||||
return [
|
return [
|
||||||
`${prefixCls}`,
|
`${prefixCls}`,
|
||||||
{
|
{
|
||||||
[`${prefixCls}-disabled`]: this.disabled
|
[`${prefixCls}-disabled`]: this.itemDisabled
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
@ -145,7 +146,7 @@
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
handleMousemove(value, event) {
|
handleMousemove(value, event) {
|
||||||
if (this.disabled) return;
|
if (this.itemDisabled) return;
|
||||||
|
|
||||||
this.isHover = true;
|
this.isHover = true;
|
||||||
if (this.allowHalf) {
|
if (this.allowHalf) {
|
||||||
|
@ -157,7 +158,7 @@
|
||||||
this.hoverIndex = value;
|
this.hoverIndex = value;
|
||||||
},
|
},
|
||||||
handleMouseleave () {
|
handleMouseleave () {
|
||||||
if (this.disabled) return;
|
if (this.itemDisabled) return;
|
||||||
|
|
||||||
this.isHover = false;
|
this.isHover = false;
|
||||||
this.setHalf(this.currentValue);
|
this.setHalf(this.currentValue);
|
||||||
|
@ -167,7 +168,7 @@
|
||||||
this.isHalf = this.allowHalf && val.toString().indexOf('.') >= 0;
|
this.isHalf = this.allowHalf && val.toString().indexOf('.') >= 0;
|
||||||
},
|
},
|
||||||
handleClick (value) {
|
handleClick (value) {
|
||||||
if (this.disabled) return;
|
if (this.itemDisabled) return;
|
||||||
//value++;
|
//value++;
|
||||||
if (this.isHalf) value -= 0.5;
|
if (this.isHalf) value -= 0.5;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue