mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Field): enable inheritAttrs
This commit is contained in:
parent
2937c1537e
commit
3c3e72cf79
@ -19,8 +19,6 @@ import { cellProps } from '../cell/shared';
|
|||||||
const [createComponent, bem] = createNamespace('field');
|
const [createComponent, bem] = createNamespace('field');
|
||||||
|
|
||||||
export default createComponent({
|
export default createComponent({
|
||||||
inheritAttrs: false,
|
|
||||||
|
|
||||||
provide() {
|
provide() {
|
||||||
return {
|
return {
|
||||||
vanField: this,
|
vanField: this,
|
||||||
@ -426,7 +424,6 @@ export default createComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const inputProps = {
|
const inputProps = {
|
||||||
...this.$attrs,
|
|
||||||
ref: 'input',
|
ref: 'input',
|
||||||
name: this.name,
|
name: this.name,
|
||||||
style: null,
|
style: null,
|
||||||
@ -570,16 +567,12 @@ export default createComponent({
|
|||||||
}}
|
}}
|
||||||
icon={this.leftIcon}
|
icon={this.leftIcon}
|
||||||
size={this.size}
|
size={this.size}
|
||||||
class={[
|
class={bem({
|
||||||
bem({
|
error: this.showError,
|
||||||
error: this.showError,
|
disabled: this.disabled,
|
||||||
disabled: this.disabled,
|
[`label-${labelAlign}`]: labelAlign,
|
||||||
[`label-${labelAlign}`]: labelAlign,
|
'min-height': this.type === 'textarea' && !this.autosize,
|
||||||
'min-height': this.type === 'textarea' && !this.autosize,
|
})}
|
||||||
}),
|
|
||||||
this.$attrs.class,
|
|
||||||
]}
|
|
||||||
style={this.$attrs.style}
|
|
||||||
center={this.center}
|
center={this.center}
|
||||||
border={this.border}
|
border={this.border}
|
||||||
isLink={this.isLink}
|
isLink={this.isLink}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user