Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i-input 添加 placeholderStyle 属性,可以自定义样式 #95

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/pages/input/index.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<i-panel title="基础用法">
<i-input value="{{ value1 }}" title="收货人" autofocus placeholder="名字" />
<i-input value="{{ value2 }}" type="number" title="联系电话" placeholder="请输入手机号" />
<i-input value="{{ value2 }}" type="number" title="联系电话" placeholderStyle="color:red;" placeholder="请输入手机号" />
<i-input value="{{ value3 }}" type="textarea" title="详细地址" placeholder="请输入详细地址(最多50字)" maxlength="50" />
<i-input value="{{ value4 }}" title="用户信息" disabled />
</i-panel>
Expand Down
4 changes: 4 additions & 0 deletions src/input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Component({
type: String,
value: ''
},
placeholderStyle: {
type: String,
value: ''
},
autofocus: {
type: Boolean,
value: false
Expand Down
2 changes: 2 additions & 0 deletions src/input/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
bindinput="handleInputChange"
bindfocus="handleInputFocus"
bindblur="handleInputBlur"
placeholder-style="{{ placeholderStyle }}"
></textarea>
<input
wx:else
Expand All @@ -27,5 +28,6 @@
bindinput="handleInputChange"
bindfocus="handleInputFocus"
bindblur="handleInputBlur"
placeholder-style="{{ placeholderStyle }}"
/>
</view>