[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,18 +1,18 @@
<template>
<transition name="van-dialog-bounce">
<div class="van-dialog" v-show="value">
<div class="van-dialog__header" v-if="title" v-text="title" />
<div class="van-dialog__content van-hairline">
<div v-show="value" :class="b()">
<div v-if="title" v-text="title" :class="b('header')" />
<div :class="b('content')" class="van-hairline">
<slot>
<div class="van-dialog__message" v-if="message" :class="{ 'van-dialog__message--withtitle': title }" v-html="message" />
<div v-if="message" v-html="message" :class="b('message', { withtitle: title })" />
</slot>
</div>
<div class="van-dialog__footer" :class="{ 'is-twobtn': showCancelButton && showConfirmButton }">
<div :class="b('footer', { 'buttons': showCancelButton && showConfirmButton })">
<van-button
v-show="showCancelButton"
:loading="loading.cancel"
size="large"
class="van-dialog__cancel"
:class="b('cancel')"
@click="handleAction('cancel')"
>
{{ cancelButtonText || $t('cancel') }}
@@ -21,8 +21,7 @@
v-show="showConfirmButton"
size="large"
:loading="loading.confirm"
class="van-dialog__confirm"
:class="{ 'van-hairline--left': showCancelButton && showConfirmButton }"
:class="[b('confirm'), { 'van-hairline--left': showCancelButton && showConfirmButton }]"
@click="handleAction('confirm')"
>
{{ confirmButtonText || $t('confirm') }}