cool-admin-vue/.vscode/crud.code-snippets

103 lines
2.3 KiB
Plaintext
Raw Normal View History

2021-02-28 01:55:04 +08:00
{
"cl-crud": {
"prefix": "cl-crud",
2023-09-28 13:50:15 +08:00
"scope": "vue",
2021-02-28 01:55:04 +08:00
"body": [
"<template>",
2023-09-28 13:50:15 +08:00
" <cl-crud ref=\"Crud\">",
" <cl-row>",
2021-02-28 01:55:04 +08:00
" <!-- 刷新按钮 -->",
" <cl-refresh-btn />",
" <!-- 新增按钮 -->",
" <cl-add-btn />",
" <!-- 删除按钮 -->",
" <cl-multi-delete-btn />",
" <cl-flex1 />",
" <!-- 关键字搜索 -->",
" <cl-search-key />",
2023-09-28 13:50:15 +08:00
" </cl-row>",
2021-02-28 01:55:04 +08:00
"",
2023-09-28 13:50:15 +08:00
" <cl-row>",
2021-02-28 01:55:04 +08:00
" <!-- 数据表格 -->",
2023-09-28 13:50:15 +08:00
" <cl-table ref=\"Table\" />",
" </cl-row>",
2021-02-28 01:55:04 +08:00
"",
2023-09-28 13:50:15 +08:00
" <cl-row>",
2021-02-28 01:55:04 +08:00
" <cl-flex1 />",
" <!-- 分页控件 -->",
" <cl-pagination />",
2023-09-28 13:50:15 +08:00
" </cl-row>",
2021-02-28 01:55:04 +08:00
"",
" <!-- 新增、编辑 -->",
2023-09-28 13:50:15 +08:00
" <cl-upsert ref=\"Upsert\" />",
2021-02-28 01:55:04 +08:00
" </cl-crud>",
"</template>",
"",
2023-09-28 13:50:15 +08:00
"<script lang=\"ts\" name=\"菜单名称\" setup>",
"import { useCrud, useTable, useUpsert } from \"@cool-vue/crud\";",
"import { useCool } from \"/@/cool\";",
"",
"const { service } = useCool();",
"",
"// cl-upsert",
"const Upsert = useUpsert({",
" items: []",
"});",
"",
"// cl-table",
"const Table = useTable({",
" columns: []",
"});",
"",
"// cl-crud",
"const Crud = useCrud(",
" {",
" service: service.demo.goods",
2021-02-28 01:55:04 +08:00
" },",
2023-09-28 13:50:15 +08:00
" (app) => {",
" app.refresh();",
2021-02-28 01:55:04 +08:00
" }",
2023-09-28 13:50:15 +08:00
");",
"",
"// 刷新",
"function refresh(params?: any) {",
" Crud.value?.refresh(params);",
"}",
2021-02-28 01:55:04 +08:00
"</script>",
""
],
"description": "cl-crud snippets"
2023-09-28 13:50:15 +08:00
},
"cl-filter": {
"prefix": "cl-filter",
"scope": "html",
"body": [
"<cl-filter label=\"\">",
" <cl-select :options=\"[$1]\" prop=\"\" />",
"</cl-filter>"
],
"description": "cl-filter snippets"
},
"item": {
"prefix": "item",
"scope": "typescript",
"body": [
"{",
" label: \"$1\",",
" prop: \"\",",
" component: {",
" name: \"\"",
" }",
"},",
""
],
"description": "item snippets"
},
"column": {
"prefix": "column",
"scope": "typescript",
"body": ["{", " label: \"$1\",", " prop: \"\",", "},", ""],
"description": "column snippets"
2021-02-28 01:55:04 +08:00
}
}