brand-cate-box.vue
1000 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
39
<template>
<tab v-bind:page="'cate'"></tab>
<brand-cate v-bind:category="category" v-bind:jump="true"></brand-cate>
</template>
<script>
const tip = require('common/tip');
const brandCate = require('channel/brand-cate.vue');
const tab = require('channel/tab.vue');
const $ = require('jquery');
module.exports = {
data() {
return {
category: {}
};
},
components: {
tab,
brandCate
},
methods: {
getCateList() {
$.ajax({
url: '/cate/list.json'
}).then(result => {
if (result.code === 200 && result.data) {
this.$set('category', result.data);
}
}).fail(() => {
tip('网络错误');
});
}
},
created() {
this.getCateList();
}
};
</script>