[improvement] optimize wxml (#858)

This commit is contained in:
neverland 2018-11-06 14:49:38 +08:00 committed by GitHub
parent 0de7ec38e4
commit a234c97852
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 57 deletions

View File

@ -1,12 +1,23 @@
<demo-block title="基本用法">
<van-radio-group value="{{ radio1 }}" data-key="radio1" bind:change="onChange" custom-class="demo-radio-group">
<demo-block title="基本用法" padding>
<van-radio-group
value="{{ radio1 }}"
data-key="radio1"
custom-class="demo-radio-group"
bind:change="onChange"
>
<van-radio name="1" custom-class="demo-radio">单选框 1</van-radio>
<van-radio name="2" custom-class="demo-radio">单选框 2</van-radio>
</van-radio-group>
</demo-block>
<demo-block title="禁用状态">
<van-radio-group value="{{ radio2 }}" data-key="radio2" bind:change="onChange" disabled custom-class="demo-radio-group">
<demo-block title="禁用状态" padding>
<van-radio-group
disabled
value="{{ radio2 }}"
data-key="radio2"
custom-class="demo-radio-group"
bind:change="onChange"
>
<van-radio name="1" custom-class="demo-radio">单选框 1</van-radio>
<van-radio name="2" custom-class="demo-radio">单选框 2</van-radio>
</van-radio-group>

View File

@ -1,3 +1 @@
<view class="custom-class">
<slot />
</view>

View File

@ -1,3 +1 @@
<view class="custom-class">
<slot />
</view>

View File

@ -2,7 +2,6 @@
class="van-search custom-class {{ showAction || useActionSlot ? 'van-search--show-action' : '' }}"
style="background: {{ background }}"
>
<view class="van-search__field">
<van-field
clearable
type="search"
@ -11,6 +10,7 @@
error="{{ error }}"
border="{{ false }}"
confirm-type="search"
class="van-search__field"
value="{{ value }}"
disabled="{{ disabled }}"
readonly="{{ readony }}"
@ -24,7 +24,6 @@
bind:change="onChange"
bind:confirm="onSearch"
/>
</view>
<view wx:if="{{ showAction || useActionSlot }}" class="van-search__action">
<slot wx:if="{{ useActionSlot }}" name="action" />
<view wx:else bind:tap="onCancel" class="cancel-class">取消</view>

View File

@ -5,12 +5,8 @@
<view class="van-tabbar-item__icon {{ dot ? 'van-tabbar-item__icon--dot' : '' }}">
<van-icon wx:if="{{ icon }}" name="{{ icon }}" info="{{ info }}" />
<block wx:else>
<block wx:if="{{ active }}">
<slot name="icon-active" />
</block>
<block wx:else>
<slot name="icon" />
</block>
<slot wx:if="{{ active }}" name="icon-active" />
<slot wx:else name="icon" />
<view wx:if="{{ info !== null }}" class="van-icon__info">{{ info }}</view>
</block>
</view>