Showing
3 changed files
with
32 additions
and
14 deletions
1 | const Vue = require('yoho-vue'); | 1 | const Vue = require('yoho-vue'); |
2 | const lazyload = require('yoho-vue-lazyload'); | 2 | const lazyload = require('yoho-vue-lazyload'); |
3 | -const qs = require('yoho-qs'); | ||
4 | -const contentCode = require('content-code'); | ||
5 | 3 | ||
6 | -const tab = require('channel/tab.vue'); | ||
7 | -const resources = require('component/resources/index.vue'); | 4 | +const channel = require('channel/index.vue'); |
8 | 5 | ||
9 | require('common/vue-filter'); | 6 | require('common/vue-filter'); |
10 | 7 | ||
@@ -12,14 +9,7 @@ Vue.use(lazyload); | @@ -12,14 +9,7 @@ Vue.use(lazyload); | ||
12 | 9 | ||
13 | new Vue({ | 10 | new Vue({ |
14 | el: '#channel', | 11 | el: '#channel', |
15 | - data() { | ||
16 | - return { | ||
17 | - page: 'channel', | ||
18 | - contentCode: contentCode.channel[qs.channel || 'men'] | ||
19 | - }; | ||
20 | - }, | ||
21 | components: { | 12 | components: { |
22 | - tab: tab, | ||
23 | - resources: resources | 13 | + channel |
24 | } | 14 | } |
25 | }); | 15 | }); |
public/vue/channel/index.vue
0 → 100644
1 | +<template> | ||
2 | + <tab v-bind:page="page"></tab> | ||
3 | + <resources v-bind:content-code.sync="contentCode"></resources> | ||
4 | +</template> | ||
5 | + | ||
6 | +<script> | ||
7 | + const qs = require('yoho-qs'); | ||
8 | + const contentCode = require('content-code'); | ||
9 | + | ||
10 | + const tab = require('channel/tab.vue'); | ||
11 | + const resources = require('component/resources/index.vue'); | ||
12 | + | ||
13 | + module.exports = { | ||
14 | + data() { | ||
15 | + return { | ||
16 | + page: 'channel', | ||
17 | + contentCode: contentCode.channel[qs.channel || 'men'] | ||
18 | + }; | ||
19 | + }, | ||
20 | + components: { | ||
21 | + tab: tab, | ||
22 | + resources: resources | ||
23 | + } | ||
24 | + }; | ||
25 | +</script> | ||
26 | + | ||
27 | +<style> | ||
28 | + | ||
29 | +</style> |
-
Please register or login to post a comment