mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 19:24:16 +00:00
fix(Checkbox): only the icon is clickable when label-disabled
This commit is contained in:
@@ -54,7 +54,7 @@ export default {
|
||||
### Custom Icon Size
|
||||
|
||||
```html
|
||||
<van-checkbox v-model="checked" icon-size="25px">Checkbox</van-checkbox>
|
||||
<van-checkbox v-model="checked" icon-size="24px">Checkbox</van-checkbox>
|
||||
```
|
||||
|
||||
### Custom Icon
|
||||
|
@@ -39,7 +39,7 @@ export default {
|
||||
|
||||
### 禁用文本点击
|
||||
|
||||
通过设置`label-disabled`属性可以禁用复选框文本点击
|
||||
设置`label-disabled`属性后,点击复选框图标以外的内容不会触发切换
|
||||
|
||||
```html
|
||||
<van-checkbox v-model="checked" icon-disabled>复选框</van-checkbox>
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
通过`icon-size`属性可以自定义图标的大小
|
||||
|
||||
```html
|
||||
<van-checkbox v-model="checked" icon-size="25px">复选框</van-checkbox>
|
||||
<van-checkbox v-model="checked" icon-size="24px">复选框</van-checkbox>
|
||||
```
|
||||
|
||||
### 自定义图标
|
||||
|
@@ -32,7 +32,7 @@
|
||||
</demo-block>
|
||||
|
||||
<demo-block :title="$t('customIconSize')">
|
||||
<van-checkbox v-model="checboxIcon" icon-size="25px">
|
||||
<van-checkbox v-model="checboxIcon" icon-size="24px">
|
||||
{{ $t('customIconSize') }}
|
||||
</van-checkbox>
|
||||
</demo-block>
|
||||
|
@@ -9,13 +9,13 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div role="checkbox" tabindex="-1" aria-checked="false" class="van-checkbox">
|
||||
<div role="checkbox" tabindex="-1" aria-checked="false" class="van-checkbox van-checkbox--disabled">
|
||||
<div class="van-checkbox__icon van-checkbox__icon--round van-checkbox__icon--disabled"><i class="van-icon van-icon-success">
|
||||
<!----></i></div><span class="van-checkbox__label van-checkbox__label--disabled">
|
||||
复选框
|
||||
</span>
|
||||
</div>
|
||||
<div role="checkbox" tabindex="-1" aria-checked="true" class="van-checkbox">
|
||||
<div role="checkbox" tabindex="-1" aria-checked="true" class="van-checkbox van-checkbox--disabled">
|
||||
<div class="van-checkbox__icon van-checkbox__icon--round van-checkbox__icon--disabled van-checkbox__icon--checked"><i class="van-icon van-icon-success">
|
||||
<!----></i></div><span class="van-checkbox__label van-checkbox__label--disabled">
|
||||
复选框
|
||||
@@ -23,7 +23,7 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div role="checkbox" tabindex="0" aria-checked="true" class="van-checkbox">
|
||||
<div role="checkbox" tabindex="0" aria-checked="true" class="van-checkbox van-checkbox--label-disabled">
|
||||
<div class="van-checkbox__icon van-checkbox__icon--round van-checkbox__icon--checked"><i class="van-icon van-icon-success">
|
||||
<!----></i></div><span class="van-checkbox__label">
|
||||
复选框
|
||||
@@ -48,7 +48,7 @@ exports[`renders demo correctly 1`] = `
|
||||
</div>
|
||||
<div>
|
||||
<div role="checkbox" tabindex="0" aria-checked="true" class="van-checkbox">
|
||||
<div class="van-checkbox__icon van-checkbox__icon--round van-checkbox__icon--checked" style="font-size: 25px;"><i class="van-icon van-icon-success">
|
||||
<div class="van-checkbox__icon van-checkbox__icon--round van-checkbox__icon--checked" style="font-size: 24px;"><i class="van-icon van-icon-success">
|
||||
<!----></i></div><span class="van-checkbox__label">
|
||||
自定义大小
|
||||
</span>
|
||||
|
@@ -27,7 +27,7 @@ exports[`icon-size prop 1`] = `
|
||||
`;
|
||||
|
||||
exports[`label disabled 1`] = `
|
||||
<div role="checkbox" tabindex="0" aria-checked="undefined" class="van-checkbox">
|
||||
<div role="checkbox" tabindex="0" aria-checked="undefined" class="van-checkbox van-checkbox--label-disabled">
|
||||
<div class="van-checkbox__icon van-checkbox__icon--round"><i class="van-icon van-icon-success">
|
||||
<!----></i></div><span class="van-checkbox__label">Label</span>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user