demo.vue
701 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
<template>
<div class="">
<tabBar @on-change="onIndexChange" :tabList="tabList"></tabBar>
</div>
</template>
<script>
import tabBar from 'components/tabBar/index'
export default {
components: {
tabBar
},
data () {
return {
tabList: [
{
name: '首页',
imgurl: '',
num: '2',
selected: false,
link: ''
},
{
name: '购物车',
imgurl: '',
num: '',
selected: true,
link: ''
}
]
}
},
methods: {
onIndexChange (index) {
console.warn(index)
}
}
}
</script>