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
| <template>
| <div class="demo">
| <cl-crud @load="onLoad">
| <el-row>
| <cl-refresh-btn />
| <cl-add-btn />
| <cl-multi-delete-btn />
| <demo-dialog />
| <demo-context-menu />
| <demo-form />
| <demo-query />
| <cl-flex1 />
| <cl-search-key
| field="name"
| :field-list="[
| { label: '姓名', value: 'name' },
| { label: '年龄', value: 'age' }
| ]"
| />
| <demo-adv-search />
| </el-row>
| <el-row>
| <demo-table />
| </el-row>
| <el-row>
| <cl-flex1 />
| <cl-pagination />
| </el-row>
| <demo-upsert />
| </cl-crud>
| </div>
| </template>
| <script lang="ts">
| import { defineComponent } from "vue";
| import { TestService } from "../utils/service";
| import Dialog from "../components/crud/dialog.vue";
| import ContextMenu from "../components/crud/context-menu.vue";
| import Query from "../components/crud/query.vue";
| import AdvSearch from "../components/crud/adv-search.vue";
| import Table from "../components/crud/table.vue";
| import Upsert from "../components/crud/upsert.vue";
| import Form from "../components/crud/form.vue";
| import { CrudLoad } from "@cool-vue/crud/types";
| export default defineComponent({
| name: "crud",
| components: {
| "demo-dialog": Dialog,
| "demo-context-menu": ContextMenu,
| "demo-query": Query,
| "demo-adv-search": AdvSearch,
| "demo-table": Table,
| "demo-upsert": Upsert,
| "demo-form": Form
| },
| setup() {
| function onLoad({ ctx, app }: CrudLoad) {
| ctx.service(TestService).done();
| app.refresh();
| }
| return {
| onLoad
| };
| }
| });
| </script>
| <style lang="scss">
| html,
| body,
| #app,
| .demo {
| height: 100%;
| overflow: hidden;
| }
| * {
| padding: 0;
| margin: 0;
| }
| </style>
|
|