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