diff --git a/packages/field/index.js b/packages/field/index.js index cb82fc55a..6054872c8 100644 --- a/packages/field/index.js +++ b/packages/field/index.js @@ -67,10 +67,7 @@ export default sfc({ const { labelWidth } = this; if (labelWidth) { const width = isNumber(String(labelWidth)) ? `${labelWidth}px` : labelWidth; - return { - maxWidth: width, - minWidth: width - }; + return { width }; } } }, diff --git a/packages/field/index.less b/packages/field/index.less index f262898e5..8d932835f 100644 --- a/packages/field/index.less +++ b/packages/field/index.less @@ -2,7 +2,8 @@ .van-field { &__label { - max-width: @field-label-max-width; + flex: none; + width: @field-label-width; &--center { text-align: center; diff --git a/packages/field/test/__snapshots__/index.spec.js.snap b/packages/field/test/__snapshots__/index.spec.js.snap index d7de2096e..813d0fc81 100644 --- a/packages/field/test/__snapshots__/index.spec.js.snap +++ b/packages/field/test/__snapshots__/index.spec.js.snap @@ -19,7 +19,7 @@ exports[`clearable 2`] = ` exports[`label-width prop with unit 1`] = `