[improvement] TabbarItem: add slot-scope to avoid check by index (#347)

* [improvement] TabbarItem: add slot-scope to avoid check by index

* [fix] TabbarItem: fix slot-scope on <template> to support vue v2.1.0+
This commit is contained in:
Li Chuangbo
2017-11-24 11:10:32 +08:00
committed by neverland
parent 1f1632a7eb
commit f7bd71969d
4 changed files with 23 additions and 5 deletions
+2 -2
View File
@@ -1,13 +1,13 @@
<template>
<div class="van-tabbar-item" :class="{ 'van-tabbar-item--active': active }" @click="onClick">
<div class="van-tabbar-item__icon" :class="{ 'van-tabbar-item__icon-dot': dot }">
<slot name="icon">
<slot name="icon" :active="active">
<van-icon v-if="icon" :name="icon" />
</slot>
<div v-if="info" class="van-tabbar-item__info">{{ info }}</div>
</div>
<div class="van-tabbar-item__text">
<slot></slot>
<slot :active="active"></slot>
</div>
</div>
</template>