Authored by 郭成尧

Merge remote-tracking branch 'remotes/origin/develop' into feature/brand

<div id="channel">
<tab v-bind:page="page"></tab>
<resources v-bind:content-code.sync="contentCode"></resources>
<channel></channel>
</div>
... ...
const Vue = require('yoho-vue');
const lazyload = require('yoho-vue-lazyload');
const qs = require('yoho-qs');
const contentCode = require('content-code');
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
const channel = require('channel/index.vue');
require('common/vue-filter');
... ... @@ -12,14 +9,7 @@ Vue.use(lazyload);
new Vue({
el: '#channel',
data() {
return {
page: 'channel',
contentCode: contentCode.channel[qs.channel || 'men']
};
},
components: {
tab: tab,
resources: resources
channel
}
});
... ...
<template>
<tab v-bind:page="page"></tab>
<resources v-bind:content-code="contentCode"></resources>
</template>
<script>
const qs = require('yoho-qs');
const contentCode = require('content-code');
const bus = require('common/vue-bus');
const tab = require('channel/tab.vue');
const resources = require('component/resources/index.vue');
module.exports = {
data() {
return {
page: 'channel',
contentCode: contentCode.channel[qs.channel || 'men']
};
},
components: {
tab: tab,
resources: resources
},
created() {
bus.$on('contentCode.change', (code) => {
this.contentCode = code;
});
}
};
</script>
<style>
</style>
... ...
... ... @@ -37,7 +37,7 @@
methods: {
changeChannel(index) {
this.current = index;
bus.$emit('changeChannel', this.page, this.channel[index].channel);
bus.$emit('channel.change', this.page, this.channel[index].channel);
}
}
};
... ...
... ... @@ -61,6 +61,7 @@
watch: {
contentCode() {
this.getResourcesData();
bus.$emit('contentCode.change', this.contentCode);
}
},
methods: {
... ... @@ -94,7 +95,7 @@
},
created() {
this.getResourcesData();
bus.$on('changeChannel', (page, channel) => {
bus.$on('channel.change', (page, channel) => {
this.contentCode = contentCode[page][channel];
});
}
... ...