161 lines
5.1 KiB
Plaintext
161 lines
5.1 KiB
Plaintext
{
|
|
"mldong-art-design-dialog": {
|
|
"prefix": "dialog",
|
|
"body": [
|
|
"<template>",
|
|
" <Dialog> 我是弹窗内容 </Dialog>",
|
|
"</template>",
|
|
"<script setup lang=\"tsx\">",
|
|
" import { useDialog } from '@/components/dialog'",
|
|
" import { CrudMethods } from '@/components/crud'",
|
|
" const record = ref<any>({})",
|
|
" const crudApi = ref<CrudMethods>()",
|
|
" const [Dialog, dialogApi] = useDialog({",
|
|
" title: '我是标题',",
|
|
" width: '50%'",
|
|
" })",
|
|
" defineExpose({",
|
|
" show({ data, getCrudApi }: { data: any; getCrudApi: () => CrudMethods }) {",
|
|
" record.value = data",
|
|
" crudApi.value = getCrudApi()",
|
|
" dialogApi.open()",
|
|
" }",
|
|
" })",
|
|
"</script>",
|
|
"<style lang=\"scss\" scoped></style>",
|
|
""
|
|
],
|
|
"description": "生成mldong-art-design dialog模板"
|
|
},
|
|
"mldong-art-design-dialog-drawer": {
|
|
"prefix": "drawer",
|
|
"body": [
|
|
"<template>",
|
|
" <Dialog> 我是弹窗内容 </Dialog>",
|
|
"</template>",
|
|
"<script setup lang=\"tsx\">",
|
|
" import { useDialog } from '@/components/dialog'",
|
|
" import { CrudMethods } from '@/components/crud'",
|
|
" const record = ref<any>({})",
|
|
" const crudApi = ref<CrudMethods>()",
|
|
" const [Dialog, dialogApi] = useDialog({",
|
|
" title: '我是标题',",
|
|
" width: '50%',",
|
|
" dialogType: 'drawer'",
|
|
" })",
|
|
" defineExpose({",
|
|
" show({ data, getCrudApi }: { data: any; getCrudApi: () => CrudMethods }) {",
|
|
" record.value = data",
|
|
" crudApi.value = getCrudApi()",
|
|
" dialogApi.open()",
|
|
" }",
|
|
" })",
|
|
"</script>",
|
|
"<style lang=\"scss\" scoped></style>",
|
|
""
|
|
],
|
|
"description": "生成mldong-art-design dialog-drawer模板"
|
|
},
|
|
"mldong-art-design-dialog-form": {
|
|
"prefix": "dialog-form",
|
|
"body": [
|
|
"<template>",
|
|
" <Dialog>",
|
|
" <BasicForm />",
|
|
" </Dialog>",
|
|
"</template>",
|
|
"<script setup lang=\"tsx\">",
|
|
" import { useDialog } from '@/components/dialog'",
|
|
" import { CrudMethods } from '@/components/crud'",
|
|
" import { useForm } from '@/components/form'",
|
|
" const record = ref<any>({})",
|
|
" const crudApi = ref<CrudMethods>()",
|
|
" const [Dialog, dialogApi] = useDialog({",
|
|
" title: '我是标题',",
|
|
" width: '50%',",
|
|
" onConfirm() {",
|
|
" formApi.validate().then(async () => {",
|
|
" const values = await formApi.getValues()",
|
|
" console.log(values)",
|
|
" })",
|
|
" }",
|
|
" })",
|
|
" const [BasicForm, formApi] = useForm({",
|
|
" labelWidth: '120px',",
|
|
" schema: [",
|
|
" {",
|
|
" prop: 'name',",
|
|
" label: '姓名',",
|
|
" component: 'Input',",
|
|
" rules: [{ required: true, message: '请输入姓名' }]",
|
|
" }",
|
|
" ]",
|
|
" })",
|
|
" defineExpose({",
|
|
" show({ data, getCrudApi }: { data: any; getCrudApi: () => CrudMethods }) {",
|
|
" record.value = data",
|
|
" crudApi.value = getCrudApi()",
|
|
" dialogApi.open()",
|
|
" nextTick(() => {",
|
|
" formApi.setValues(record.value)",
|
|
" })",
|
|
" }",
|
|
" })",
|
|
"</script>",
|
|
"<style lang=\"scss\" scoped></style>"
|
|
],
|
|
"description": "生成mldong-art-design dialog-form模板"
|
|
},
|
|
"mldong-art-design-drawer-form": {
|
|
"prefix": "drawer-form",
|
|
"body": [
|
|
"<template>",
|
|
" <Dialog>",
|
|
" <BasicForm />",
|
|
" </Dialog>",
|
|
"</template>",
|
|
"<script setup lang=\"tsx\">",
|
|
" import { useDialog } from '@/components/dialog'",
|
|
" import { CrudMethods } from '@/components/crud'",
|
|
" import { useForm } from '@/components/form'",
|
|
" const record = ref<any>({})",
|
|
" const crudApi = ref<CrudMethods>()",
|
|
" const [Dialog, dialogApi] = useDialog({",
|
|
" title: '我是标题',",
|
|
" width: '50%',",
|
|
" dialogType: 'drawer',",
|
|
" onConfirm() {",
|
|
" formApi.validate().then(async () => {",
|
|
" const values = await formApi.getValues()",
|
|
" console.log(values)",
|
|
" })",
|
|
" }",
|
|
" })",
|
|
" const [BasicForm, formApi] = useForm({",
|
|
" labelWidth: '120px',",
|
|
" schema: [",
|
|
" {",
|
|
" prop: 'name',",
|
|
" label: '姓名',",
|
|
" component: 'Input',",
|
|
" rules: [{ required: true, message: '请输入姓名' }]",
|
|
" }",
|
|
" ]",
|
|
" })",
|
|
" defineExpose({",
|
|
" show({ data, getCrudApi }: { data: any; getCrudApi: () => CrudMethods }) {",
|
|
" record.value = data",
|
|
" crudApi.value = getCrudApi()",
|
|
" dialogApi.open()",
|
|
" nextTick(() => {",
|
|
" formApi.setValues(record.value)",
|
|
" })",
|
|
" }",
|
|
" })",
|
|
"</script>",
|
|
"<style lang=\"scss\" scoped></style>"
|
|
],
|
|
"description": "生成mldong-art-design drawer-form模板"
|
|
}
|
|
}
|