titleSubTitleCom.vue
769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<template>
<div class="title-sub-title-com" v-if="item && item.title" @click="changeTab(item)">
<div class="title-box" :class="{'active': item.active}">
<div class="title">
{{item.title}}
</div>
<div class="sub-title" v-if="item.subTitle">
{{item.subTitle}}
</div>
</div>
<div class="line" v-if="line"></div>
</div>
</template>
<script>
export default {
data() {
return {
};
},
props: ["item", "line"],
methods: {
/**
* 切换标签
* @param {object} item [对象]
*/
changeTab(item) {
this.$emit("changeTab", item);
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style rel="stylesheet/less" lang='less' scoped>
@import './titleSubTitleCom';
</style>