perf: inject default
parent
c9d3f7b79c
commit
de68d08798
|
@ -24,7 +24,7 @@ export default function connect(mapStateToProps) {
|
||||||
name: `Connect_${getDisplayName(WrappedComponent)}`,
|
name: `Connect_${getDisplayName(WrappedComponent)}`,
|
||||||
props,
|
props,
|
||||||
inject: {
|
inject: {
|
||||||
storeContext: { default: {} },
|
storeContext: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.store = this.storeContext.store;
|
this.store = this.storeContext.store;
|
||||||
|
|
|
@ -15,8 +15,8 @@ export default {
|
||||||
href: '#',
|
href: '#',
|
||||||
}),
|
}),
|
||||||
inject: {
|
inject: {
|
||||||
antAnchor: { default: {} },
|
antAnchor: { default: () => ({}) },
|
||||||
antAnchorContext: { default: {} },
|
antAnchorContext: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
|
@ -142,8 +142,8 @@ const Cascader = {
|
||||||
event: 'change',
|
event: 'change',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
localeData: { default: {} },
|
localeData: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
this.cachedOptions = [];
|
this.cachedOptions = [];
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default {
|
||||||
prop: 'checked',
|
prop: 'checked',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
checkboxGroupContext: { default: null },
|
checkboxGroupContext: { default: () => null },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChange(event) {
|
handleChange(event) {
|
||||||
|
|
|
@ -35,7 +35,7 @@ const Drawer = {
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
parentDrawer: {
|
parentDrawer: {
|
||||||
default: null,
|
default: () => null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
provide() {
|
provide() {
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default {
|
||||||
event: 'visibleChange',
|
event: 'visibleChange',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
|
|
@ -21,7 +21,7 @@ const Dropdown = {
|
||||||
event: 'visibleChange',
|
event: 'visibleChange',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getTransitionName() {
|
getTransitionName() {
|
||||||
|
|
|
@ -46,8 +46,8 @@ export default {
|
||||||
colon: true,
|
colon: true,
|
||||||
}),
|
}),
|
||||||
inject: {
|
inject: {
|
||||||
FormProps: { default: {} },
|
FormProps: { default: () => ({}) },
|
||||||
decoratorFormProps: { default: {} },
|
decoratorFormProps: { default: () => ({}) },
|
||||||
collectFormItemContext: { default: () => noop },
|
collectFormItemContext: { default: () => noop },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default {
|
||||||
name: 'ACol',
|
name: 'ACol',
|
||||||
inject: {
|
inject: {
|
||||||
rowContext: {
|
rowContext: {
|
||||||
default: null,
|
default: () => null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -108,7 +108,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
siderHook: { default: {} },
|
siderHook: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
// getChildContext() {
|
// getChildContext() {
|
||||||
// return {
|
// return {
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
||||||
Meta,
|
Meta,
|
||||||
props: ListItemProps,
|
props: ListItemProps,
|
||||||
inject: {
|
inject: {
|
||||||
listContext: { default: {} },
|
listContext: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default {
|
||||||
children: PropTypes.func,
|
children: PropTypes.func,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
localeData: { default: {} },
|
localeData: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getLocale() {
|
getLocale() {
|
||||||
|
|
|
@ -49,8 +49,8 @@ const Menu = {
|
||||||
},
|
},
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
inject: {
|
inject: {
|
||||||
layoutSiderContext: { default: {} },
|
layoutSiderContext: { default: () => ({}) },
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
prop: 'selectedKeys',
|
prop: 'selectedKeys',
|
||||||
|
|
|
@ -107,7 +107,7 @@ const Select = {
|
||||||
event: 'change',
|
event: 'change',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
warning(
|
warning(
|
||||||
|
|
|
@ -87,7 +87,7 @@ const TimePicker = {
|
||||||
event: 'change',
|
event: 'change',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const value = this.value || this.defaultValue;
|
const value = this.value || this.defaultValue;
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default {
|
||||||
event: 'visibleChange',
|
event: 'visibleChange',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -34,7 +34,7 @@ const TreeSelect = {
|
||||||
event: 'change',
|
event: 'change',
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
configProvider: { default: {} },
|
configProvider: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
warning(
|
warning(
|
||||||
|
|
|
@ -21,7 +21,7 @@ const BaseTable = {
|
||||||
isAnyColumnsFixed: PropTypes.bool,
|
isAnyColumnsFixed: PropTypes.bool,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
table: { default: {} },
|
table: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getColumns(cols) {
|
getColumns(cols) {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default {
|
||||||
isAnyColumnsFixed: PropTypes.bool,
|
isAnyColumnsFixed: PropTypes.bool,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
table: { default: {} },
|
table: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updateTableRef();
|
this.updateTableRef();
|
||||||
|
|
|
@ -7,7 +7,7 @@ export default {
|
||||||
columns: PropTypes.array,
|
columns: PropTypes.array,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
table: { default: {} },
|
table: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { fixed, table } = this;
|
const { fixed, table } = this;
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
expander: PropTypes.object.isRequired,
|
expander: PropTypes.object.isRequired,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
table: { default: {} },
|
table: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.updateTableRef();
|
this.updateTableRef();
|
||||||
|
|
|
@ -41,7 +41,7 @@ export default {
|
||||||
expander: PropTypes.object.isRequired,
|
expander: PropTypes.object.isRequired,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
table: { default: {} },
|
table: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ export default {
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
sentinelContext: { default: {} },
|
sentinelContext: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const { destroyInactiveTabPane, active, forceRender, rootPrefixCls } = this.$props;
|
const { destroyInactiveTabPane, active, forceRender, rootPrefixCls } = this.$props;
|
||||||
|
|
|
@ -101,7 +101,7 @@ const BasePopup = {
|
||||||
__propsSymbol__: PropTypes.any,
|
__propsSymbol__: PropTypes.any,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
vcTreeSelect: { default: {} },
|
vcTreeSelect: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
__propsSymbol__() {
|
__propsSymbol__() {
|
||||||
|
|
|
@ -52,7 +52,7 @@ export default function(modeName) {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
inject: {
|
inject: {
|
||||||
vcTreeSelect: { default: {} },
|
vcTreeSelect: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.domRef = createRef();
|
this.domRef = createRef();
|
||||||
|
|
|
@ -20,7 +20,7 @@ const SearchInput = {
|
||||||
ariaId: PropTypes.string,
|
ariaId: PropTypes.string,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
vcTreeSelect: { default: {} },
|
vcTreeSelect: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
|
|
@ -29,7 +29,7 @@ const MultipleSelector = {
|
||||||
// onChoiceAnimationLeave: PropTypes.func,
|
// onChoiceAnimationLeave: PropTypes.func,
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
vcTreeSelect: { default: {} },
|
vcTreeSelect: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.inputRef = createRef();
|
this.inputRef = createRef();
|
||||||
|
|
|
@ -58,8 +58,8 @@ const TreeNode = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
vcTree: { default: {} },
|
vcTree: { default: () => ({}) },
|
||||||
vcTreeNode: { default: {} },
|
vcTreeNode: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
inject: {
|
inject: {
|
||||||
vcTriggerContext: { default: {} },
|
vcTriggerContext: { default: () => ({}) },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const props = this.$props;
|
const props = this.$props;
|
||||||
|
|
Loading…
Reference in New Issue