From 8b6b50611045005ee7f3a037fa11a7b30ea4b2a3 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 18 Jan 2020 17:06:09 +0800 Subject: [PATCH] perf: update some attrs --- components/_util/proxyComponent.jsx | 3 +-- components/_util/store/connect.jsx | 3 +-- components/grid/Col.jsx | 2 -- components/input/Password.jsx | 1 + components/input/TextArea.jsx | 1 + components/input/__tests__/__snapshots__/demo.test.js.snap | 2 +- components/input/demo/textarea-resize.md | 2 +- components/modal/Modal.jsx | 3 +++ components/vc-dialog/DialogWrap.jsx | 1 + 9 files changed, 10 insertions(+), 8 deletions(-) diff --git a/components/_util/proxyComponent.jsx b/components/_util/proxyComponent.jsx index f1e8083e7..e8aeee39d 100644 --- a/components/_util/proxyComponent.jsx +++ b/components/_util/proxyComponent.jsx @@ -23,7 +23,7 @@ export default function wrapWithConnect(WrappedComponent) { }, }, render() { - const { $listeners, $slots = {}, $attrs, $scopedSlots } = this; + const { $listeners, $slots = {}, $scopedSlots } = this; const props = getOptionProps(this); const wrapProps = { props: { @@ -33,7 +33,6 @@ export default function wrapWithConnect(WrappedComponent) { children: $slots.default || props.children || [], }, on: $listeners, - attrs: $attrs, }; if (Object.keys($scopedSlots).length) { wrapProps.scopedSlots = $scopedSlots; diff --git a/components/_util/store/connect.jsx b/components/_util/store/connect.jsx index fcc642ddb..fb2274980 100644 --- a/components/_util/store/connect.jsx +++ b/components/_util/store/connect.jsx @@ -81,7 +81,7 @@ export default function connect(mapStateToProps) { }, render() { this.preProps = { ...this.$props }; - const { $listeners, $slots = {}, $attrs, $scopedSlots, subscribed, store } = this; + const { $listeners, $slots = {}, $scopedSlots, subscribed, store } = this; const props = getOptionProps(this); this.preProps = { ...omit(props, ['__propsSymbol__']) }; const wrapProps = { @@ -91,7 +91,6 @@ export default function connect(mapStateToProps) { store, }, on: $listeners, - attrs: $attrs, scopedSlots: $scopedSlots, }; return ( diff --git a/components/grid/Col.jsx b/components/grid/Col.jsx index 3b2bdfb00..9e54de797 100644 --- a/components/grid/Col.jsx +++ b/components/grid/Col.jsx @@ -46,7 +46,6 @@ export default { pull, prefixCls: customizePrefixCls, $slots, - $attrs, $listeners, rowContext, } = this; @@ -82,7 +81,6 @@ export default { }; const divProps = { on: $listeners, - attrs: $attrs, class: classes, style: {}, }; diff --git a/components/input/Password.jsx b/components/input/Password.jsx index e0d435744..4e610a7c1 100644 --- a/components/input/Password.jsx +++ b/components/input/Password.jsx @@ -14,6 +14,7 @@ const ActionMap = { export default { name: 'AInputPassword', mixins: [BaseMixin], + inheritAttrs: false, model: { prop: 'value', event: 'change.value', diff --git a/components/input/TextArea.jsx b/components/input/TextArea.jsx index 3301bc322..3e86c138d 100644 --- a/components/input/TextArea.jsx +++ b/components/input/TextArea.jsx @@ -30,6 +30,7 @@ function noop() {} export default { name: 'ATextarea', + inheritAttrs: false, model: { prop: 'value', event: 'change.value', diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index fb18d91ed..28ecba084 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -62,6 +62,6 @@ exports[`renders ./components/input/demo/size.md correctly 1`] = `
`; -exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `
`; +exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `
`; exports[`renders ./components/input/demo/tooltip.md correctly 1`] = ``; diff --git a/components/input/demo/textarea-resize.md b/components/input/demo/textarea-resize.md index d81670ec5..f0bf68233 100644 --- a/components/input/demo/textarea-resize.md +++ b/components/input/demo/textarea-resize.md @@ -12,7 +12,7 @@ For multi-line input.