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

67 lines
1.6 KiB
Plaintext
Raw Normal View History

2021-02-28 01:55:04 +08:00
{
"cl-crud": {
2022-04-08 13:19:55 +08:00
"prefix": "cl-crud",
2022-07-21 19:07:32 +08:00
"scope": "vue",
2021-02-28 01:55:04 +08:00
"body": [
"<template>",
2022-04-02 22:50:51 +08:00
" <cl-crud ref=\"Crud\">",
2023-01-09 15:37:56 +08:00
" <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-01-09 15:37:56 +08:00
" </cl-row>",
2021-02-28 01:55:04 +08:00
"",
2023-01-09 15:37:56 +08:00
" <cl-row>",
2021-02-28 01:55:04 +08:00
" <!-- 数据表格 -->",
2022-04-02 22:50:51 +08:00
" <cl-table ref=\"Table\" />",
2023-01-09 15:37:56 +08:00
" </cl-row>",
2021-02-28 01:55:04 +08:00
"",
2023-01-09 15:37:56 +08:00
" <cl-row>",
2021-02-28 01:55:04 +08:00
" <cl-flex1 />",
" <!-- 分页控件 -->",
" <cl-pagination />",
2023-01-09 15:37:56 +08:00
" </cl-row>",
2021-02-28 01:55:04 +08:00
"",
" <!-- 新增、编辑 -->",
2022-04-02 22:50:51 +08:00
" <cl-upsert ref=\"Upsert\" />",
2021-02-28 01:55:04 +08:00
" </cl-crud>",
"</template>",
"",
2022-07-21 19:07:32 +08:00
"<script lang=\"ts\" name=\"菜单名称\" setup>",
2022-04-02 22:50:51 +08:00
"import { useCrud, useTable, useUpsert } from \"@cool-vue/crud\";",
2021-12-05 23:09:33 +08:00
"import { useCool } from \"/@/cool\";",
2021-03-29 11:59:09 +08:00
"",
2022-07-21 19:07:32 +08:00
"const { service } = useCool();",
2021-03-29 11:59:09 +08:00
"",
2022-04-02 22:50:51 +08:00
"// cl-upsert 配置",
"const Upsert = useUpsert({",
" items: []",
"});",
2021-03-29 11:59:09 +08:00
"",
2022-04-02 22:50:51 +08:00
"// cl-table 配置",
"const Table = useTable({",
" columns: []",
"});",
2021-03-29 11:59:09 +08:00
"",
2022-04-02 22:50:51 +08:00
"// cl-crud 配置",
"const Crud = useCrud(",
" {",
" service: service.demo.goods",
" },",
" (app) => {",
" app.refresh();",
2021-02-28 01:55:04 +08:00
" }",
2022-04-02 22:50:51 +08:00
");",
2021-02-28 01:55:04 +08:00
"</script>",
""
],
"description": "cl-crud snippets"
}
}