ydcss / vue-ydui

A mobile components Library with Vue2.js. 一只基于Vue2.x的移动端组件库。
http://vue.ydui.org
MIT License
2.75k stars 559 forks source link

TabbarItem自己再封装一层,样式始终高亮的问题 #610

Closed lamjack closed 6 years ago

lamjack commented 6 years ago

问题描述

因为需要自己实现图标,涉及一些业务逻辑,所以把做多一层封装,但是发现所有Item一直都是高亮的。

2018-05-26 12 16 13

产生环境

代码区域

页面部分代码,

<template>
    <yd-layout>
        <router-view :key="$route.path"></router-view>
        <yd-tabbar slot="tabbar">
            <tabbar-item></tabbar-item>
            <tabbar-item></tabbar-item>
            <tabbar-item></tabbar-item>
        </yd-tabbar>
    </yd-layout>
</template>

<script>
import TabbarItem from '../components/TabbarItem';

export default {
    name: 'Frame',
    components: { TabbarItem }
};
</script>

封装组件部分代码,

<template>
    <yd-tabbar-item title="123" link="#">
        <yd-icon name="home" slot="icon"></yd-icon>
    </yd-tabbar-item>
</template>

<script>
export default {
    name: 'TabbarItem',
};
</script>
lamjack commented 6 years ago

找到原因了。