Skip to content

Commit

Permalink
perf: update some attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
tangjinzhou committed Jan 18, 2020
1 parent 3cb68f5 commit 8b6b506
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions components/_util/proxyComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions components/_util/store/connect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -91,7 +91,6 @@ export default function connect(mapStateToProps) {
store,
},
on: $listeners,
attrs: $attrs,
scopedSlots: $scopedSlots,
};
return (
Expand Down
2 changes: 0 additions & 2 deletions components/grid/Col.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default {
pull,
prefixCls: customizePrefixCls,
$slots,
$attrs,
$listeners,
rowContext,
} = this;
Expand Down Expand Up @@ -82,7 +81,6 @@ export default {
};
const divProps = {
on: $listeners,
attrs: $attrs,
class: classes,
style: {},
};
Expand Down
1 change: 1 addition & 0 deletions components/input/Password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const ActionMap = {
export default {
name: 'AInputPassword',
mixins: [BaseMixin],
inheritAttrs: false,
model: {
prop: 'value',
event: 'change.value',
Expand Down
1 change: 1 addition & 0 deletions components/input/TextArea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function noop() {}

export default {
name: 'ATextarea',
inheritAttrs: false,
model: {
prop: 'value',
event: 'change.value',
Expand Down
2 changes: 1 addition & 1 deletion components/input/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ exports[`renders ./components/input/demo/size.md correctly 1`] = `<div class="co
exports[`renders ./components/input/demo/textarea.md correctly 1`] = `<textarea placeholder="Basic usage" rows="4" class="ant-input"></textarea>`;
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>`;
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>`;
exports[`renders ./components/input/demo/tooltip.md correctly 1`] = `<input placeholder="Input a number" type="text" maxlength="25" class="ant-input" style="width: 120px;">`;
2 changes: 1 addition & 1 deletion components/input/demo/textarea-resize.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For multi-line input.
<template>
<div>
<a-button style="margin-bottom: 16px" @click="() => this.autoResize = !autoResize">
Auto Resize: {String(autoResize)}
Auto Resize: {{String(autoResize)}}
</a-button>
<a-textarea :rows="4" :autosize="autoResize" :defaultValue="defaultValue" />
</div>
Expand Down
3 changes: 3 additions & 0 deletions components/modal/Modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const destroyFns = [];

export default {
name: 'AModal',
inheritAttrs: false,
model: {
prop: 'visible',
event: 'change',
Expand Down Expand Up @@ -161,6 +162,7 @@ export default {
centered,
$listeners,
$slots,
$attrs,
} = this;

const getPrefixCls = this.configProvider.getPrefixCls;
Expand Down Expand Up @@ -197,6 +199,7 @@ export default {
},
class: getClass(this),
style: getStyle(this),
attrs: $attrs,
};
return <Dialog {...dialogProps}>{$slots.default}</Dialog>;
},
Expand Down
1 change: 1 addition & 0 deletions components/vc-dialog/DialogWrap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getStyle, getClass } from '../_util/props-util';
const IDialogPropTypes = getDialogPropTypes();
let openCount = 0;
const DialogWrap = {
inheritAttrs: false,
props: {
...IDialogPropTypes,
visible: IDialogPropTypes.visible.def(false),
Expand Down

0 comments on commit 8b6b506

Please sign in to comment.