Commit aac56ccb by 姜雷

控件添加change事件

parent f4a9602e
...@@ -26,7 +26,7 @@ export default { ...@@ -26,7 +26,7 @@ export default {
value: Number, value: Number,
disabled: Boolean, disabled: Boolean,
clearable: { clearable: {
type:Boolean, type: Boolean,
default: true, default: true,
}, },
}, },
...@@ -35,8 +35,10 @@ export default { ...@@ -35,8 +35,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (val) { if (val) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} else { } else {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} }
}, },
}, },
......
...@@ -40,8 +40,10 @@ export default { ...@@ -40,8 +40,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (val || val === 0) { if (val || val === 0) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} else { } else {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} }
}, },
disabledValue(val) { disabledValue(val) {
......
...@@ -54,6 +54,12 @@ export default { ...@@ -54,6 +54,12 @@ export default {
}); });
} }
}, },
methods: {
changeHandle(val) {
this.$emit('input', val);
this.$emit('change', val);
},
},
}; };
</script> </script>
...@@ -26,9 +26,6 @@ export default { ...@@ -26,9 +26,6 @@ export default {
}, },
methods: { methods: {
...mapActions(actionsList), ...mapActions(actionsList),
changeHandle(val) {
this.$emit('input', val);
},
getOptionsList(label) { getOptionsList(label) {
let optionValue = this.getOptionsValue(label); let optionValue = this.getOptionsValue(label);
if (optionValue) { if (optionValue) {
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
methods: { methods: {
changeHandle(val) { changeHandle(val) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
}, },
}, },
}; };
......
...@@ -31,7 +31,7 @@ export default { ...@@ -31,7 +31,7 @@ export default {
}, },
disabled: Boolean, disabled: Boolean,
clearable: { clearable: {
type:Boolean, type: Boolean,
default: true, default: true,
}, },
}, },
...@@ -46,8 +46,10 @@ export default { ...@@ -46,8 +46,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (!val) { if (!val) {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} else { } else {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} }
}, },
}, },
......
...@@ -40,8 +40,10 @@ export default { ...@@ -40,8 +40,10 @@ export default {
changeHandle(val) { changeHandle(val) {
if (val || val === 0) { if (val || val === 0) {
this.$emit('input', val); this.$emit('input', val);
this.$emit('change', val);
} else { } else {
this.$emit('input', null); this.$emit('input', null);
this.$emit('change', null);
} }
}, },
}, },
......
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
import rymUi from 'rym-element-ui'; import rymUi from 'rym-element-ui';
import 'rym-element-ui/lib/rymUi.css'; import 'rym-element-ui/lib/rymUi.css';
import errorHandler from './errorHandler'; // import errorHandler from './errorHandler';
import HeaderImg from '../components/HeaderImg/HeaderImg.vue'; import HeaderImg from '../components/HeaderImg/HeaderImg.vue';
import UserWithContent from '../components/UserCard/UserWithContent.vue'; import UserWithContent from '../components/UserCard/UserWithContent.vue';
...@@ -37,7 +37,7 @@ const extendVue = Vue => { ...@@ -37,7 +37,7 @@ const extendVue = Vue => {
Vue.prototype.$formatterMoneyToDouble = formatterMoneyToDouble; Vue.prototype.$formatterMoneyToDouble = formatterMoneyToDouble;
Vue.prototype.$formatPrice = formatPrice; Vue.prototype.$formatPrice = formatPrice;
Vue.config.errorHandler = errorHandler; // Vue.config.errorHandler = errorHandler;
Vue.component('UserCard', UserCard); Vue.component('UserCard', UserCard);
Vue.component('UserInfo', UserInfo); Vue.component('UserInfo', UserInfo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment