wangzhibo
昨天 5e756b5a69bcd957f8eafc5f99a4f6413691d6dd
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{
    "cl-crud": {
        "prefix": "cl-crud",
        "scope": "vue",
        "body": [
            "<template>",
            "    <cl-crud ref=\"Crud\">",
            "        <cl-row>",
            "            <!-- 刷新按钮 -->",
            "            <cl-refresh-btn />",
            "            <!-- 新增按钮 -->",
            "            <cl-add-btn />",
            "            <!-- 删除按钮 -->",
            "            <cl-multi-delete-btn />",
            "            <cl-flex1 />",
            "            <!-- 条件搜索 -->",
            "            <cl-search ref=\"Search\" />",
            "        </cl-row>",
            "",
            "        <cl-row>",
            "            <!-- 数据表格 -->",
            "            <cl-table ref=\"Table\" />",
            "        </cl-row>",
            "",
            "        <cl-row>",
            "            <cl-flex1 />",
            "            <!-- 分页控件 -->",
            "            <cl-pagination />",
            "        </cl-row>",
            "",
            "        <!-- 新增、编辑 -->",
            "        <cl-upsert ref=\"Upsert\" />",
            "    </cl-crud>",
            "</template>",
            "",
            "<script lang=\"ts\" setup>",
            "defineOptions({",
            "    name: \"$1\"",
            "});",
            "",
            "import { useCrud, useTable, useUpsert, useSearch } from \"@cool-vue/crud\";",
            "import { useCool } from \"/@/cool\";",
            "",
            "const { service } = useCool();",
            "",
            "// cl-upsert",
            "const Upsert = useUpsert({",
            "    items: []",
            "});",
            "",
            "// cl-table",
            "const Table = useTable({",
            "    columns: []",
            "});",
            "",
            "// cl-search",
            "const Search = useSearch();",
            "",
            "// cl-crud",
            "const Crud = useCrud(",
            "    {",
            "        service: service$2",
            "    },",
            "    (app) => {",
            "        app.refresh();",
            "    }",
            ");",
            "",
            "// 刷新",
            "function refresh(params?: any) {",
            "    Crud.value?.refresh(params);",
            "}",
            "</script>",
            ""
        ],
        "description": "cl-crud snippets"
    },
    "cl-filter": {
        "prefix": "cl-filter",
        "scope": "html",
        "body": [
            "<cl-filter label=\"\">",
            "    <cl-select :options=\"[$1]\" prop=\"\" />",
            "</cl-filter>"
        ],
        "description": "cl-filter snippets"
    },
    "slot-item": {
        "prefix": "slot item",
        "scope": "html",
        "body": ["<template #slot-$1=\"{ scope }\">", "</template>", ""],
        "description": "slot snippets"
    },
    "slot-column": {
        "prefix": "slot column",
        "scope": "html",
        "body": ["<template #column-$1=\"{ scope }\">", "    ", "</template>", ""],
        "description": "column slot snippets"
    }
}