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