perf: update some attrs

This commit is contained in:
tangjinzhou 2020-01-18 17:06:09 +08:00
parent 3cb68f5ec6
commit 8b6b506110
9 changed files with 10 additions and 8 deletions

View File

@ -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;

View File

@ -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 (

View File

@ -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: {},
};

View File

@ -14,6 +14,7 @@ const ActionMap = {
export default {
name: 'AInputPassword',
mixins: [BaseMixin],
inheritAttrs: false,
model: {
prop: 'value',
event: 'change.value',

View File

@ -30,6 +30,7 @@ function noop() {}
export default {
name: 'ATextarea',
inheritAttrs: false,
model: {
prop: 'value',
event: 'change.value',

View File

@ -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;">`;

View File

@ -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>

View File

@ -75,6 +75,7 @@ export const destroyFns = [];
export default {
name: 'AModal',
inheritAttrs: false,
model: {
prop: 'visible',
event: 'change',
@ -161,6 +162,7 @@ export default {
centered,
$listeners,
$slots,
$attrs,
} = this;
const getPrefixCls = this.configProvider.getPrefixCls;
@ -197,6 +199,7 @@ export default {
},
class: getClass(this),
style: getStyle(this),
attrs: $attrs,
};
return <Dialog {...dialogProps}>{$slots.default}</Dialog>;
},

View File

@ -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),