This commit is contained in:
陈嘉涵 2018-09-29 16:09:12 +08:00
parent 41055623c6
commit c1f962b17b
5 changed files with 17 additions and 10 deletions

View File

@ -1,7 +1,13 @@
<view class="van-checkbox custom-class">
<view class="van-checkbox__icon-wrap" bindtap="toggle">
<slot wx:if="{{ useIconSlot }}" name="icon" />
<van-icon class="{{ iconClass }}" custom-class="icon-class" wx:else name="success" />
<van-icon
wx:else
name="success"
class="{{ iconClass }}"
custom-class="icon-class"
custom-style="line-height: 20px;"
/>
</view>
<view class="van-checkbox__label van-checkbox__label--{{ labelPosition }} label-class" bindtap="onClickLabel">
<slot />

2
dist/field/index.js vendored
View File

@ -24,7 +24,7 @@ VantComponent({
customStyle: String,
useIconSlot: Boolean,
useButtonSlot: Boolean,
placeholderClass: String,
placeholderStyle: String,
cursorSpacing: {
type: Number,
value: 50

14
dist/field/index.wxml vendored
View File

@ -16,12 +16,12 @@
class="{{ inputClass }}"
focus="{{ focus }}"
value="{{ value }}"
disabled="{{ disabled }}"
readonly="{{ readonly }}"
disabled="{{ disabled || readonly }}"
maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}"
auto-height="{{ autosize }}"
placeholder-class="{{ placeholderClass }} {{ error ? 'van-field--error' : '' }}"
placeholder="{{ placeholder }}"
placeholder-style="{{ placeholderStyle }} "
placeholder-class="{{ error ? 'van-field--error' : '' }}"
cursor-spacing="{{ cursorSpacing }}"
bindinput="onInput"
bind:blur="onBlur"
@ -34,11 +34,11 @@
type="{{ type }}"
focus="{{ focus }}"
value="{{ value }}"
disabled="{{ disabled }}"
readonly="{{ readonly }}"
disabled="{{ disabled || readonly }}"
maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}"
placeholder-class="{{ placeholderClass }} {{ error ? 'van-field--error' : '' }}"
placeholder-style="{{ placeholderStyle }} "
placeholder-class="{{ error ? 'van-field--error' : '' }}"
confirm-type="{{ confirmType }}"
cursor-spacing="{{ cursorSpacing }}"
bindinput="onInput"

1
dist/icon/index.js vendored
View File

@ -5,6 +5,7 @@ VantComponent({
name: String,
size: String,
color: String,
customStyle: String,
classPrefix: {
type: String,
value: 'van-icon'

View File

@ -1,6 +1,6 @@
<view
class="custom-class {{ classPrefix }} {{ classPrefix }}-{{ name }}"
style="{{ color ? 'color: ' + color : '' }}; {{ size ? 'font-size: ' + size : '' }}"
style="{{ color ? 'color: ' + color + ';' : '' }}{{ size ? 'font-size: ' + size + ';' : '' }}{{ customStyle }}"
bind:tap="onClick"
>
<view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view>