style: remove not use mixins
parent
3aeeeb2aed
commit
ba560a37fe
|
@ -1,44 +0,0 @@
|
|||
import { nextTick } from 'vue';
|
||||
import { getOptionProps } from './props-util';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
setState(state = {}, callback) {
|
||||
let newState = typeof state === 'function' ? state(this, this.$props) : state;
|
||||
if (this.getDerivedStateFromProps) {
|
||||
const s = this.getDerivedStateFromProps(getOptionProps(this), {
|
||||
...this,
|
||||
...newState,
|
||||
});
|
||||
if (s === null) {
|
||||
return;
|
||||
} else {
|
||||
newState = { ...newState, ...(s || {}) };
|
||||
}
|
||||
}
|
||||
Object.assign(this, newState);
|
||||
if (this._.isMounted) {
|
||||
this.$forceUpdate();
|
||||
}
|
||||
nextTick(() => {
|
||||
callback && callback();
|
||||
});
|
||||
},
|
||||
__emit() {
|
||||
// 直接调用事件,底层组件不需要vueTool记录events
|
||||
const args = [].slice.call(arguments, 0);
|
||||
let eventName = args[0];
|
||||
eventName = `on${eventName[0].toUpperCase()}${eventName.substring(1)}`;
|
||||
const event = this.$props[eventName] || this.$attrs[eventName];
|
||||
if (args.length && event) {
|
||||
if (Array.isArray(event)) {
|
||||
for (let i = 0, l = event.length; i < l; i++) {
|
||||
event[i](...args.slice(1));
|
||||
}
|
||||
} else {
|
||||
event(...args.slice(1));
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
|
@ -5,7 +5,6 @@ import PropTypes from '../_util/vue-types';
|
|||
import Row from '../grid/Row';
|
||||
import type { ColProps } from '../grid/Col';
|
||||
import { filterEmpty } from '../_util/props-util';
|
||||
import BaseMixin from '../_util/BaseMixin';
|
||||
import { validateRules as validateRulesUtil } from './utils/validateUtil';
|
||||
import { getNamePath } from './utils/valueUtil';
|
||||
import { toArray } from './utils/typeUtil';
|
||||
|
@ -97,7 +96,6 @@ const defaultItemNamePrefixCls = 'form_item';
|
|||
|
||||
export default defineComponent({
|
||||
name: 'AFormItem',
|
||||
mixins: [BaseMixin],
|
||||
inheritAttrs: false,
|
||||
__ANT_NEW_FORM_ITEM: true,
|
||||
props: formItemProps,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import type { CSSProperties, VNodeTypes, PropType } from 'vue';
|
||||
import { computed, ref, defineComponent } from 'vue';
|
||||
import BaseMixin from '../_util/BaseMixin';
|
||||
import VcSlider from '../vc-slider/src/Slider';
|
||||
import VcRange from '../vc-slider/src/Range';
|
||||
import VcHandle from '../vc-slider/src/Handle';
|
||||
|
@ -75,7 +74,6 @@ export type Visibles = { [index: number]: boolean };
|
|||
|
||||
const Slider = defineComponent({
|
||||
name: 'ASlider',
|
||||
mixins: [BaseMixin],
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
...sliderProps(),
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import type { ImgHTMLAttributes, CSSProperties } from 'vue';
|
||||
import { ref, watch, defineComponent, computed, onMounted } from 'vue';
|
||||
import isNumber from 'lodash-es/isNumber';
|
||||
|
||||
import BaseMixin from '../../_util/BaseMixin';
|
||||
import cn from '../../_util/classNames';
|
||||
import PropTypes from '../../_util/vue-types';
|
||||
import { getOffset } from '../../vc-util/Dom/css';
|
||||
|
@ -61,7 +59,6 @@ const mergeDefaultValue = <T extends object>(obj: T, defaultValues: object): T =
|
|||
let uuid = 0;
|
||||
const ImageInternal = defineComponent({
|
||||
name: 'Image',
|
||||
mixins: [BaseMixin],
|
||||
inheritAttrs: false,
|
||||
props: imageProps,
|
||||
emits: ['click'],
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import PropTypes from '../_util/vue-types';
|
||||
import BaseMixin from '../_util/BaseMixin';
|
||||
import { filterEmpty } from '../_util/props-util';
|
||||
import { cloneElement } from '../_util/vnode';
|
||||
import { defineComponent } from 'vue';
|
||||
|
@ -24,7 +23,6 @@ export type ProgressDotRender = (info: {
|
|||
|
||||
export default defineComponent({
|
||||
name: 'Steps',
|
||||
mixins: [BaseMixin],
|
||||
props: {
|
||||
type: PropTypes.string.def('default'),
|
||||
prefixCls: PropTypes.string.def('vc-steps'),
|
||||
|
|
Loading…
Reference in New Issue