[Improvement] component use bem mixin (#921)

This commit is contained in:
neverland
2018-04-24 11:53:06 +08:00
committed by GitHub
parent 86184e090e
commit b0f4096e88
14 changed files with 66 additions and 56 deletions

View File

@@ -1,19 +1,23 @@
<template>
<div
v-clickoutside:touchstart="onClick"
class="van-cell-swipe"
:class="b()"
@click="onClick('cell')"
@touchstart="startDrag"
@touchmove="onDrag"
@touchend="endDrag"
@touchcancel="endDrag"
>
<div class="van-cell-swipe__wrapper" :style="wrapperStyle" @transitionend="swipe = false">
<div class="van-cell-swipe__left" @click.stop="onClick('left')" v-if="leftWidth">
<div
:class="b('wrapper')"
:style="wrapperStyle"
@transitionend="swipe = false"
>
<div v-if="leftWidth" :class="b('left')" @click.stop="onClick('left')">
<slot name="left" />
</div>
<slot />
<div class="van-cell-swipe__right" @click.stop="onClick('right')" v-if="rightWidth">
<div v-if="rightWidth" :class="b('right')" @click.stop="onClick('right')">
<slot name="right" />
</div>
</div>