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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
| <template>
| <div>
| <basic-container>
| <h3>表格权限控制</h3>
| <avue-crud ref="crud"
| :permission="permission"
| :option="option"
| :data="data">
| <template slot="expand"
| slot-scope="scope">
| {{scope}}
| </template>
| </avue-crud>
| </basic-container>
| <basic-container>
| 权限开关
| <el-switch :active-value="false"
| :inactive-value="true"
| v-model="text"
| active-color="#13ce66"
| inactive-color="#ff4949">
| </el-switch>
| <p> 具体参考<a
| href="https://avuex.avue.top/#/doc/crud-permission">https://avuex.avue.top/#/doc/crud-permission</a>
| </p>
| </basic-container>
| </div>
| </template>
|
| <script>
| export default {
| data() {
| return {
| text: false,
| permission: {},
| option: {
| expand: true,
| column: [
| {
| label: "姓名",
| prop: "name"
| },
| {
| label: "年龄",
| prop: "sex"
| }
| ]
| },
| data: [
| {
| id: 1,
| name: "张三",
| sex: 12
| },
| {
| id: 2,
| name: "李四",
| sex: 20
| }
| ]
| };
| },
| watch: {
| text() {
| if (this.text === true) {
| this.permission = {
| delBtn: false,
| addBtn: false
| };
| } else {
| this.permission = {
| delBtn: true,
| addBtn: true
| };
| }
| }
| }
| };
| </script>
|
| <style>
| </style>
|
|