mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
* [bugfix] Checkbox border render error in weixin browser * [bugfix] TreeSelect dependency path error * [bugfix] Swipe should clear autoplay timer when destroyed * [bugfix] Optimize component dependency analyze when build style entry * merge * update yarn.lock * update README.md * update README.md * update README.md * update README.md * update README.md * [Doc] add more badges in README.md * update README.md * [bugfix] Address & Contact list style * fix: contact test cases * [bugfix] popup style missing when build style entry * [bugfix] Search: onSearch event arguments missing * [Doc] add demo pages * update zan-doc@0.3.7 * fix: build entry error * [Doc] add goods demo * [bugfix] button primary background color * [Doc] update doc detail * [new feature] Coupon add 'showExchangeBar' prop && add empty style * [new feature] Toast support `position` prop * [new feature] Tabbar add 'info' prop
53 lines
987 B
Vue
53 lines
987 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">
|
|
<div v-if="info" class="van-tabbar-item__info">{{ info }}</div>
|
|
</van-icon>
|
|
</slot>
|
|
</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>
|