index.vue
1.08 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
<template>
<div>
<tab :page="page" :current="currentChannel"></tab>
<resources :content-code="contentCode"></resources>
</div>
</template>
<script>
import qs from 'yoho-qs';
import cookie from 'yoho-cookie';
import contentCode from 'content-code';
import bus from 'common/vue-bus';
import tab from 'channel/tab.vue';
import resources from 'component/resources/index.vue';
const detaultChannel = qs.channel || cookie.get('_Channel') || 'men';
export default {
data() {
return {
page: 'channel',
contentCode: contentCode.channel[detaultChannel]
};
},
computed: {
currentChannel() {
return +cookie.get('_ChannelIndex') || 0;
}
},
components: {
tab,
resources
},
created() {
bus.$on('contentCode.change', (code) => {
this.contentCode = code;
});
}
};
</script>
<style>
#channel {
padding-top: 80px;
}
</style>