index.vue
2.32 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<template>
<div class="container">
<div class="doc-title zan-hairline--bottom">TAB</div>
<div style="margin: 20px 0">
<ZanTab v-bind="tab1" :componentId="'tab1'" @change="handleZanTabChange"/>
</div>
<div style="margin: 20px 0">
<ZanTab v-bind="tab2" :componentId="'tab2'" @change="handleZanTabChange"/>
</div>
<div style="margin: 20px 0">
<ZanTab v-bind="tab3" :componentId="'tab3'" @change="handleZanTabChange"/>
</div>
</div>
</template>
<script>
import ZanTab from '../../components/zan/tab'
export default {
components: {
ZanTab
},
data () {
return {
tab1: {
list: [{
id: 'all',
title: '全部'
}, {
id: 'topay',
title: '待付款'
}, {
id: 'tosend',
title: '待发货'
}, {
id: 'send',
title: '待收货'
}, {
id: 'sign',
title: '已完成订单'
}],
scroll: false,
selectedId: 'all'
},
tab2: {
list: [{
id: '1',
title: '最新商品1'
}, {
id: '2',
title: '最新商品2'
}, {
id: '3',
title: '最新商品3'
}, {
id: '4',
title: '最新商品4'
}, {
id: '5',
title: '最新商品5'
}, {
id: '6',
title: '最新商品6'
}],
selectedId: '1',
scroll: true,
height: 35
},
tab3: {
list: [{
id: '1',
title: '商品1'
}, {
id: '2',
title: '商品2'
}, {
id: '3',
title: '商品3'
}, {
id: '4',
title: '商品4'
}, {
id: '5',
title: '商品5'
}, {
id: '6',
title: '商品6'
}],
selectedId: '1',
scroll: true,
height: 25
}
}
},
methods: {
...ZanTab.methods,
handleZanTabChange (e) {
const {componentId, selectedId} = e
this[componentId].selectedId = selectedId
}
}
}
</script>
<style scoped >
</style>