[Improvement] Checkbox: support custom icon (#1414)

This commit is contained in:
neverland
2018-07-05 21:25:04 +08:00
committed by GitHub
parent 0149dc0976
commit a0602c81d5
11 changed files with 217 additions and 108 deletions

View File

@@ -1,15 +1,10 @@
<template>
<div :class="b()">
<icon
name="success"
:class="[
b('icon'),
`van-checkbox--${shape}`, {
'van-checkbox--disabled': isDisabled,
'van-checkbox--checked': checked
}]"
@click="onClick"
/>
<div :class="[b('icon', [shape, { disabled: isDisabled, checked }])]" @click="onClick">
<slot name="icon" :checked="checked">
<icon name="success" />
</slot>
</div>
<span v-if="$slots.default" :class="b('label', labelPosition)" @click="onClick('label')">
<slot />
</span>