overview.vue
1.53 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<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>