Browse Source

类型FormSlot重命名

tongshangming 1 year ago
parent
commit
c4bad92dd2

+ 0 - 1
.gitignore

@@ -8,7 +8,6 @@ pnpm-debug.log*
 lerna-debug.log*
 yarn.lock
 package-lock.json
-.gitignore
 settings.json
 auto-import.d.ts
 

+ 2 - 2
src/components/core/ProTable.vue

@@ -7,7 +7,7 @@ export default {
 <script setup lang="ts">
 import router from '@/router'
 import { ElMessage, ElMessageBox, type DialogProps } from 'element-plus'
-import type { AdvancedForm, BasicForm, ICRUD, formSlot } from '@/types/form'
+import type { AdvancedForm, BasicForm, ICRUD, FormSlot } from '@/types/form'
 import type { VXEComponent, VxeToolbarProps, VxeToolbarEventProps } from 'vxe-table'
 
 interface CustomTable {
@@ -198,7 +198,7 @@ const handleFormSuccess = () => {
 }
 
 // 构造表单插槽
-const formSlots = ref<formSlot[]>([])
+const formSlots = ref<FormSlot[]>([])
 if (props.formConfig.advanced) {
   props.formConfig.formItems.forEach((item: any) => {
     item.group.forEach((subItem: any) => Array.prototype.push.apply(formSlots.value, subItem.slots))

+ 2 - 2
src/components/core/form/DialogForm.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import type { BasicForm, AdvancedForm, formSlot } from '@/types/form'
+import type { BasicForm, AdvancedForm, FormSlot } from '@/types/form'
 import type { DialogProps } from 'element-plus'
 
 interface Props {
@@ -22,7 +22,7 @@ watchEffect(() => {
 const formRef = ref()
 
 // 构造表单插槽
-const formSlots = ref<formSlot[]>([])
+const formSlots = ref<FormSlot[]>([])
 if (props.formConfig.advanced) {
   props.formConfig.formItems.forEach((item: any) => {
     item.group.forEach((subItem: any) => Array.prototype.push.apply(formSlots.value, subItem.slots))

+ 2 - 2
src/components/core/form/ProForm.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import type { BasicForm, AdvancedForm, formSlot } from '@/types/form'
+import type { BasicForm, AdvancedForm, FormSlot } from '@/types/form'
 import { ElMessage } from 'element-plus'
 
 interface Props {
@@ -24,7 +24,7 @@ const formInitData = computed(() => {
 const formRef = ref()
 
 // 构造表单插槽
-const formSlots = ref<formSlot[]>([])
+const formSlots = ref<FormSlot[]>([])
 if (props.formConfig.advanced) {
   props.formConfig.formItems.forEach((item: any) => {
     item.group.forEach((subItem: any) => Array.prototype.push.apply(formSlots.value, subItem.slots))

+ 2 - 2
src/types/form.ts

@@ -1,6 +1,6 @@
 import type { FormProps, FormItemRule } from 'element-plus'
 
-export type formSlot = {
+export type FormSlot = {
   name: string
   alias: string
 }
@@ -21,7 +21,7 @@ export type BasicFormItem = {
   props?: object
   events?: object
   request?: Function
-  slots?: Array<formSlot>
+  slots?: Array<FormSlot>
   notFormItem?: boolean
   hidden?: boolean
 }