sort.vue 1.4 KB
<style scoped>
.index {
  width: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  text-align: center;
}
</style>
<template>
    <div class="index">
        <miniapp title="UFO分类页">
            <template>
                <template v-for="i in list">
                    <smartfloor :item="i" :key="i.resContentId"></smartfloor>
                    <divide></divide>
                </template>
            </template>
        </miniapp>
    </div>
</template>
<script>
    import miniapp from 'components/miniapp'
    import smartfloor from 'components/smart-floor'
    import divide from 'components/divide'

    import util from '@/libs/util'
    import ResourceService from '@/service/resource-service'

    export default {
        data() {
            return {
                list: [],
                resId: null
            }
        },
        mounted() {
            this.resId = util.getQueryString('id') || 2;
            this.resourceService = new ResourceService();
            this.init();

            this.$bus.$on('updated', () => {
                this.init();
            })
        },
        methods: {
            init() {
                this.resourceService.info(this.resId).then(result => {
                    this.list = result;
                })
            }
        },
        components: {
            miniapp,
            smartfloor,
            divide
        }
    };
</script>