This commit is contained in:
梁灏 2017-09-07 11:19:19 +08:00
parent 6f719603a8
commit 1f41c9ca2c
3 changed files with 40 additions and 53 deletions

View file

@ -1,8 +1,8 @@
<template>
<span :class="wrapClasses" @click="toggle">
<span :class="innerClasses">
<slot name="open" v-if="currentValue"></slot>
<slot name="close" v-if="!currentValue"></slot>
<slot name="open" v-if="currentValue === trueValue"></slot>
<slot name="close" v-if="currentValue === falseValue"></slot>
</span>
</span>
</template>
@ -48,7 +48,7 @@
return [
`${prefixCls}`,
{
[`${prefixCls}-checked`]: this.currentValue,
[`${prefixCls}-checked`]: this.currentValue === this.trueValue,
[`${prefixCls}-disabled`]: this.disabled,
[`${prefixCls}-${this.size}`]: !!this.size
}