overview.vue 1.53 KB
<template>
    <div>
            默认页
        <div style="">
            <Button v-purview="'opration'" @click="">我有权限吗?</Button>
            <editor :content="content" @change="updateData"></editor>
            <!--<Table ref="table" :data="data" :columns="columns"></Table>
            <Button @click="getTable">获得数据</Button>
            <Button @click="addRow">增加一列</Button>
            {{data}}
            <br />
            <editor :content="content" @change="updateData"></editor>
            {{content}}
            <YohoUpload id="123" @on-success="uploadSuccess" @on-error="uploadError"></YohoUpload>-->
        </div>
    </div>
</template>

<script>
export default {
    created() {
    },
    data() {
        return {
            content: '',
            columns: [
                {title: '列', key: 'name', render(row, col, index) {
                    return `<input type="text" v-model="row.name" />`;
                }}
            ],
            data: [
                {name: '1'}
            ]
        };
    },
    methods: {
        getTable() {
            console.log(this.$refs.table.rebuildData);
        },
        addRow() {
            this.data = this.$refs.table.rebuildData;
            this.data.push({name: '2'})
        },
        updateData(c) {
            this.content = c;
        },
        uploadSuccess(id, files) {
            console.log(id, files)
        },
        uploadError(id, error) {
            console.log(id, error)
        }
    }
};
</script>

<style lang="scss">

</style>