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>
| <basic-container>
| <h3>点击新增或编辑跳转到新的页面</h3>
| <avue-crud :option="option"
| :data="data">
| <template slot="menuLeft">
| <el-button type="primary"
| size="small"
| @click="handleForm()"
| icon="el-icon-plus">add</el-button>
| </template>
| <template slot="menu"
| slot-scope="{row}">
| <el-button size="small"
| type="text"
| @click="handleForm(row.id)"
| icon="el-icon-edit">edit</el-button>
| </template>
| </avue-crud>
| </basic-container>
| </template>
|
| <script>
| export default {
| data() {
| return {
| option: {
| addBtn: false,
| editBtn: false,
| column: [
| {
| label: "姓名",
| prop: "name"
| }
| ]
| },
| data: [
| {
| id: 1,
| name: "small"
| }
| ]
| };
| },
| methods: {
| handleForm(id) {
| this.$router.push({
| path: "/form-detail/index",
| query: {
| id: id
| }
| });
| }
| }
| };
| </script>
|
| <style>
| </style>
|
|