| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- {
- "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模板"
- }
- }
|