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 custom-class">
<view class="van-checkbox__icon-wrap" bindtap="toggle"> <view class="van-checkbox__icon-wrap" bindtap="toggle">
<slot wx:if="{{ useIconSlot }}" name="icon" /> <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>
<view class="van-checkbox__label van-checkbox__label--{{ labelPosition }} label-class" bindtap="onClickLabel"> <view class="van-checkbox__label van-checkbox__label--{{ labelPosition }} label-class" bindtap="onClickLabel">
<slot /> <slot />

2
dist/field/index.js vendored
View File

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

14
dist/field/index.wxml vendored
View File

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

1
dist/icon/index.js vendored
View File

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

View File

@ -1,6 +1,6 @@
<view <view
class="custom-class {{ classPrefix }} {{ classPrefix }}-{{ name }}" 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" bind:tap="onClick"
> >
<view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view> <view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view>