neverland 422e4db118
[bugfix] Tabbar cann't display info when use icon slot (#269)
* [bugfix] CouponList always show empty info

* [bugfix] add click feedback of buttons in components

* [Doc] add custom theme document

* [new feature] Notice bar support more props

* [bugfix] PullRefresh test cases

* [bugfix] unused NoticeBar style

* [bugfix] Swipe width calc error

* [Doc] english document of all action components

* [Doc] change document site path to /zanui/vant

* [Doc] fix

* [bugfix] uploader style error

* [bugfix] tabs document demo

* [new feature] Cell support vue-router target route

* [bugfix] add cell test cases

* update yarn.lock

* [bugfix] Tabbar cann't display info when use icon slot
2017-10-30 06:52:27 -05:00

52 lines
965 B
Vue

<template>
<div :class="['van-tabbar-item', { 'van-tabbar-item--active': active }]" @click="onClick">
<div :class="['van-tabbar-item__icon', { 'van-tabbar-item__icon-dot': dot }]">
<slot name="icon">
<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>
</div>
</div>
</template>
<script>
import Icon from '../icon';
export default {
name: 'van-tabbar-item',
components: {
[Icon.name]: Icon
},
props: {
icon: String,
dot: Boolean,
info: String
},
data() {
return {
active: false
};
},
beforeCreate() {
this.$parent.items.push(this);
},
destroyed() {
this.$parent.items.splice(this.$parent.items.indexOf(this), 1);
},
methods: {
onClick() {
this.$parent.onChange(this.$parent.items.indexOf(this));
}
}
};
</script>