list.vue 1.86 KB
<template>
    <div class="list">
        <button class="btn btn-primary" @click="toCreate">创建新活动</button>
        <div class="activity-list">
            <Table :columns="columns1" :data="data1"></Table>
        </div>
    </div>
</template>
<script>
    module.exports = {
        data() {
            return {
                columns1: [
                    {
                        title: 'Name',
                        key: 'name'
                    },
                    {
                        title: 'Age',
                        key: 'age'
                    },
                    {
                        title: 'Address',
                        key: 'address'
                    }
                ],
                data1: [
                    {
                        name: 'John Brown',
                        age: 18,
                        address: 'New York No. 1 Lake Park',
                        date: '2016-10-03'
                    },
                    {
                        name: 'Jim Green',
                        age: 24,
                        address: 'London No. 1 Lake Park',
                        date: '2016-10-01'
                    },
                    {
                        name: 'Joe Black',
                        age: 30,
                        address: 'Sydney No. 1 Lake Park',
                        date: '2016-10-02'
                    },
                    {
                        name: 'Jon Snow',
                        age: 26,
                        address: 'Ottawa No. 2 Lake Park',
                        date: '2016-10-04'
                    }
                ]
            }
        },
        methods: {
            toCreate() {
              this.$router.push({name: 'create'});
            }
        }
    }
</script>
<style lang="scss">
    .activity-list {
        height: 600px;
    }

</style>