mirror of https://github.com/ElemeFE/element
Carbon: add migration mixin for breaking changes
parent
f73dbe104e
commit
b678772e94
|
@ -63,12 +63,13 @@
|
|||
import Clickoutside from 'element-ui/src/utils/clickoutside';
|
||||
import ElAutocompleteSuggestions from './autocomplete-suggestions.vue';
|
||||
import Emitter from 'element-ui/src/mixins/emitter';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
import { generateId } from 'element-ui/src/utils/util';
|
||||
|
||||
export default {
|
||||
name: 'ElAutocomplete',
|
||||
|
||||
mixins: [Emitter],
|
||||
mixins: [Emitter, Migrating],
|
||||
|
||||
componentName: 'ElAutocomplete',
|
||||
|
||||
|
@ -137,6 +138,13 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'custom-item': 'custom-item is removed, use scoped slot intstead.'
|
||||
}
|
||||
};
|
||||
},
|
||||
getData(queryString) {
|
||||
this.loading = true;
|
||||
this.fetchSuggestions(queryString, (suggestions) => {
|
||||
|
|
|
@ -30,12 +30,13 @@
|
|||
|
||||
<script>
|
||||
import Popup from 'element-ui/src/utils/popup';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
|
||||
export default {
|
||||
name: 'ElDialog',
|
||||
|
||||
mixins: [Popup, emitter],
|
||||
mixins: [Popup, emitter, Migrating],
|
||||
|
||||
props: {
|
||||
title: {
|
||||
|
@ -138,6 +139,13 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'size': 'size is removed.'
|
||||
}
|
||||
};
|
||||
},
|
||||
handleWrapperClick() {
|
||||
if (!this.closeOnClickModal) return;
|
||||
this.handleClose();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script>
|
||||
import Clickoutside from 'element-ui/src/utils/clickoutside';
|
||||
import Emitter from 'element-ui/src/mixins/emitter';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
import ElButton from 'element-ui/packages/button';
|
||||
import ElButtonGroup from 'element-ui/packages/button-group';
|
||||
|
||||
|
@ -9,7 +10,7 @@
|
|||
|
||||
componentName: 'ElDropdown',
|
||||
|
||||
mixins: [Emitter],
|
||||
mixins: [Emitter, Migrating],
|
||||
|
||||
directives: { Clickoutside },
|
||||
|
||||
|
@ -75,6 +76,13 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'menu-align': 'menu-align is renamed to placement.'
|
||||
}
|
||||
};
|
||||
},
|
||||
show() {
|
||||
if (this.triggerElm.disabled) return;
|
||||
clearTimeout(this.timeout);
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
<script>
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
import Focus from 'element-ui/src/mixins/focus';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
import calcTextareaHeight from './calcTextareaHeight';
|
||||
import merge from 'element-ui/src/utils/merge';
|
||||
|
||||
|
@ -83,7 +84,7 @@
|
|||
|
||||
componentName: 'ElInput',
|
||||
|
||||
mixins: [emitter, Focus('input')],
|
||||
mixins: [emitter, Focus('input'), Migrating],
|
||||
|
||||
inject: {
|
||||
elFormItem: {
|
||||
|
@ -174,6 +175,17 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'icon': 'icon is removed, use suffix-icon / prefix-icon instead.',
|
||||
'on-icon-click': 'on-icon-click is removed.'
|
||||
},
|
||||
events: {
|
||||
'click': 'click is removed.'
|
||||
}
|
||||
};
|
||||
},
|
||||
handleBlur(event) {
|
||||
this.$emit('blur', event);
|
||||
if (this.validateEvent) {
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
import Menubar from 'element-ui/src/utils/menu/aria-menubar';
|
||||
import { addClass, removeClass, hasClass } from 'element-ui/src/utils/dom';
|
||||
|
||||
|
@ -23,7 +24,7 @@
|
|||
|
||||
componentName: 'ElMenu',
|
||||
|
||||
mixins: [emitter],
|
||||
mixins: [emitter, Migrating],
|
||||
|
||||
provide() {
|
||||
return {
|
||||
|
@ -147,6 +148,13 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'theme': 'theme is removed.'
|
||||
}
|
||||
};
|
||||
},
|
||||
getColorChannels(color) {
|
||||
color = color.replace('#', '');
|
||||
if (/^[1-9a-fA-F]{3}$/.test(color)) {
|
||||
|
|
|
@ -33,10 +33,13 @@
|
|||
|
||||
<script>
|
||||
import { hasClass } from 'element-ui/src/utils/dom';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
|
||||
export default {
|
||||
name: 'ElRate',
|
||||
|
||||
mixins: [Migrating],
|
||||
|
||||
data() {
|
||||
return {
|
||||
classMap: {},
|
||||
|
@ -205,6 +208,14 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'text-template': 'text-template is renamed to score-template.'
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
getValueFromMap(value, map) {
|
||||
let result = '';
|
||||
if (value <= this.lowThreshold) {
|
||||
|
|
|
@ -10,9 +10,13 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
|
||||
export default {
|
||||
name: 'ElSteps',
|
||||
|
||||
mixins: [Migrating],
|
||||
|
||||
props: {
|
||||
space: [Number, String],
|
||||
active: Number,
|
||||
|
@ -21,7 +25,6 @@ export default {
|
|||
default: 'horizontal'
|
||||
},
|
||||
alignCenter: Boolean,
|
||||
center: Boolean,
|
||||
simple: Boolean,
|
||||
finishStatus: {
|
||||
type: String,
|
||||
|
@ -40,6 +43,16 @@ export default {
|
|||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'center': 'center is removed.'
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
active(newVal, oldVal) {
|
||||
this.$emit('change', newVal, oldVal);
|
||||
|
@ -49,12 +62,6 @@ export default {
|
|||
steps.forEach((child, index) => {
|
||||
child.index = index;
|
||||
});
|
||||
if (this.center) {
|
||||
const len = steps.length;
|
||||
this.$nextTick(() => {
|
||||
this.stepOffset = steps[len - 1].$el.getBoundingClientRect().width / (len - 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -44,11 +44,12 @@
|
|||
import Emitter from 'element-ui/src/mixins/emitter';
|
||||
import Locale from 'element-ui/src/mixins/locale';
|
||||
import TransferPanel from './transfer-panel.vue';
|
||||
import Migrating from 'element-ui/src/mixins/migrating';
|
||||
|
||||
export default {
|
||||
name: 'ElTransfer',
|
||||
|
||||
mixins: [Emitter, Locale],
|
||||
mixins: [Emitter, Locale, Migrating],
|
||||
|
||||
components: {
|
||||
TransferPanel,
|
||||
|
@ -145,6 +146,14 @@
|
|||
},
|
||||
|
||||
methods: {
|
||||
getMigratingConfig() {
|
||||
return {
|
||||
props: {
|
||||
'footer-format': 'footer-format is renamed to format.'
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
onSourceCheckedChange(val) {
|
||||
this.leftChecked = val;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue