[Improvement] SubmitBar: optimize render (#1184)

This commit is contained in:
neverland 2018-05-29 17:26:58 +08:00 committed by GitHub
parent e31d0b4e59
commit b68ac32325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 7 deletions

View File

@ -1,6 +1,6 @@
<template>
<div :class="b()">
<div :class="b('tip')" v-show="tip || $slots.tip">
<div :class="b('tip')" v-if="tip || $slots.tip">
{{ tip }}<slot name="tip" />
</div>
<div :class="b('bar')">

View File

@ -4,8 +4,7 @@ exports[`renders demo correctly 1`] = `
<div>
<div>
<div class="van-submit-bar">
<div class="van-submit-bar__tip" style="display:none;">
</div>
<!---->
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥30.</span> <span class="van-submit-bar__price-decimal">50</span></div>
<button class="van-button van-button--danger van-button--normal">
@ -30,8 +29,7 @@ exports[`renders demo correctly 1`] = `
</div>
<div>
<div class="van-submit-bar">
<div class="van-submit-bar__tip" style="display:none;">
</div>
<!---->
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥30.</span> <span class="van-submit-bar__price-decimal">50</span></div>
<button class="van-button van-button--danger van-button--normal van-button--loading van-button--unclickable">

View File

@ -2,8 +2,7 @@
exports[`submit 1`] = `
<div class="van-submit-bar">
<div class="van-submit-bar__tip" style="display: none;">
</div>
<!---->
<div class="van-submit-bar__bar">
<div class="van-submit-bar__price"><span>合计:</span> <span class="van-submit-bar__price-integer">¥0.</span> <span class="van-submit-bar__price-decimal">00</span></div>
<button disabled="disabled" class="van-button van-button--danger van-button--normal van-button--disabled van-button--unclickable">