Skip to content

Commit 8b6b506

Browse files
committed
perf: update some attrs
1 parent 3cb68f5 commit 8b6b506

File tree

9 files changed

+10
-8
lines changed

9 files changed

+10
-8
lines changed

components/_util/proxyComponent.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function wrapWithConnect(WrappedComponent) {
2323
},
2424
},
2525
render() {
26-
const { $listeners, $slots = {}, $attrs, $scopedSlots } = this;
26+
const { $listeners, $slots = {}, $scopedSlots } = this;
2727
const props = getOptionProps(this);
2828
const wrapProps = {
2929
props: {
@@ -33,7 +33,6 @@ export default function wrapWithConnect(WrappedComponent) {
3333
children: $slots.default || props.children || [],
3434
},
3535
on: $listeners,
36-
attrs: $attrs,
3736
};
3837
if (Object.keys($scopedSlots).length) {
3938
wrapProps.scopedSlots = $scopedSlots;

components/_util/store/connect.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export default function connect(mapStateToProps) {
8181
},
8282
render() {
8383
this.preProps = { ...this.$props };
84-
const { $listeners, $slots = {}, $attrs, $scopedSlots, subscribed, store } = this;
84+
const { $listeners, $slots = {}, $scopedSlots, subscribed, store } = this;
8585
const props = getOptionProps(this);
8686
this.preProps = { ...omit(props, ['__propsSymbol__']) };
8787
const wrapProps = {
@@ -91,7 +91,6 @@ export default function connect(mapStateToProps) {
9191
store,
9292
},
9393
on: $listeners,
94-
attrs: $attrs,
9594
scopedSlots: $scopedSlots,
9695
};
9796
return (

components/grid/Col.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export default {
4646
pull,
4747
prefixCls: customizePrefixCls,
4848
$slots,
49-
$attrs,
5049
$listeners,
5150
rowContext,
5251
} = this;
@@ -82,7 +81,6 @@ export default {
8281
};
8382
const divProps = {
8483
on: $listeners,
85-
attrs: $attrs,
8684
class: classes,
8785
style: {},
8886
};

components/input/Password.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const ActionMap = {
1414
export default {
1515
name: 'AInputPassword',
1616
mixins: [BaseMixin],
17+
inheritAttrs: false,
1718
model: {
1819
prop: 'value',
1920
event: 'change.value',

components/input/TextArea.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ function noop() {}
3030

3131
export default {
3232
name: 'ATextarea',
33+
inheritAttrs: false,
3334
model: {
3435
prop: 'value',
3536
event: 'change.value',

components/input/__tests__/__snapshots__/demo.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ exports[`renders ./components/input/demo/size.md correctly 1`] = `<div class="co
6262
6363
exports[`renders ./components/input/demo/textarea.md correctly 1`] = `<textarea placeholder="Basic usage" rows="4" class="ant-input"></textarea>`;
6464
65-
exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `<div><button type="button" class="ant-btn" style="margin-bottom: 16px;"><span>Auto Resize: {String(autoResize)}</span></button> <textarea rows="4" class="ant-input"></textarea></div>`;
65+
exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `<div><button type="button" class="ant-btn" style="margin-bottom: 16px;"><span>Auto Resize: false</span></button> <textarea rows="4" class="ant-input"></textarea></div>`;
6666
6767
exports[`renders ./components/input/demo/tooltip.md correctly 1`] = `<input placeholder="Input a number" type="text" maxlength="25" class="ant-input" style="width: 120px;">`;

components/input/demo/textarea-resize.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For multi-line input.
1212
<template>
1313
<div>
1414
<a-button style="margin-bottom: 16px" @click="() => this.autoResize = !autoResize">
15-
Auto Resize: {String(autoResize)}
15+
Auto Resize: {{String(autoResize)}}
1616
</a-button>
1717
<a-textarea :rows="4" :autosize="autoResize" :defaultValue="defaultValue" />
1818
</div>

components/modal/Modal.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export const destroyFns = [];
7575

7676
export default {
7777
name: 'AModal',
78+
inheritAttrs: false,
7879
model: {
7980
prop: 'visible',
8081
event: 'change',
@@ -161,6 +162,7 @@ export default {
161162
centered,
162163
$listeners,
163164
$slots,
165+
$attrs,
164166
} = this;
165167

166168
const getPrefixCls = this.configProvider.getPrefixCls;
@@ -197,6 +199,7 @@ export default {
197199
},
198200
class: getClass(this),
199201
style: getStyle(this),
202+
attrs: $attrs,
200203
};
201204
return <Dialog {...dialogProps}>{$slots.default}</Dialog>;
202205
},

components/vc-dialog/DialogWrap.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getStyle, getClass } from '../_util/props-util';
55
const IDialogPropTypes = getDialogPropTypes();
66
let openCount = 0;
77
const DialogWrap = {
8+
inheritAttrs: false,
89
props: {
910
...IDialogPropTypes,
1011
visible: IDialogPropTypes.visible.def(false),

0 commit comments

Comments
 (0)