Skip to content

Commit 358e687

Browse files
committed
fix(Input): 修复 width 属性无效的问题
由于width属性名写错,导致width不生效 由于属性设置为 750rpx,导致 Input 样式在很多情况下不正确 close #860,#744
1 parent 9a5f152 commit 358e687

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/input/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Component({
4848
},
4949
// 表单项的宽度,单位rpx
5050
width: {
51-
type: Number,
52-
value: 750
51+
type: String,
52+
value: 'auto'
5353
},
5454
// 表单项标题部分的宽度,单位rpx
5555
labelWidth: {

src/input/index.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
position: relative;
55
font-size: 28rpx;
66
color: #333;
7-
width: 750rpx;
87
height: 88rpx;
9-
// background: #f6f6f6;
108
display: flex;
119
flex-direction: row;
1210
align-items: center;

src/input/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- input/input.wxml -->
22
<label
33
class='form-item {{disabled? "disabled": ""}} l-class form-item-{{labelLayout}}'
4-
style="widthform-item:{{width}}rpx">
4+
style="width:{{width}}rpx">
55
<view class='mask' wx:if="{{disabled}}"></view>
66
<view class='row' hidden="{{ showRow ? '' : 'hidden' }}" style="width:{{width}}rpx;"></view>
77
<view wx:if="{{label && !labelCustom}}" hidden="{{hideLabel}}" class='form-label l-label-class form-label-{{labelLayout}}' style='{{labelLayout !== "top" ? "width:"+ labelWidth+ "rpx;" : "" }} height:{{labelLayout=== "top" ? labelWidth + "rpx" : "" }}'>

0 commit comments

Comments
 (0)