brand-cate-box.vue 1000 Bytes
<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>