Browse Source

chore: prettier

xingyuv 2 years ago
parent
commit
2b605bd212
4 changed files with 9 additions and 13 deletions
  1. 2 0
      .prettierignore
  2. 0 8
      src/types/auto-components.d.ts
  3. 5 1
      src/types/auto-imports.d.ts
  4. 2 4
      src/views/system/post/form.vue

+ 2 - 0
.prettierignore

@@ -5,5 +5,7 @@
 /docs/*
 /vite.config.ts
 /src/types/env.d.ts
+/src/types/auto-components.d.ts
+/src/types/auto-imports.d.ts
 /docs/**/*
 CHANGELOG

+ 0 - 8
src/types/auto-components.d.ts

@@ -21,7 +21,6 @@ declare module '@vue/runtime-core' {
     DictTag: typeof import('./../components/DictTag/src/DictTag.vue')['default']
     Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
     Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
-    ElAvatar: typeof import('element-plus/es')['ElAvatar']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
@@ -52,19 +51,14 @@ declare module '@vue/runtime-core' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
     ElInput: typeof import('element-plus/es')['ElInput']
-    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElLink: typeof import('element-plus/es')['ElLink']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
-    ElRadio: typeof import('element-plus/es')['ElRadio']
-    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
-    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
     ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSpace: typeof import('element-plus/es')['ElSpace']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
@@ -72,9 +66,7 @@ declare module '@vue/runtime-core' {
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
-    ElTransfer: typeof import('element-plus/es')['ElTransfer']
     ElTree: typeof import('element-plus/es')['ElTree']
-    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     Error: typeof import('./../components/Error/src/Error.vue')['default']
     FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default']

+ 5 - 1
src/types/auto-imports.d.ts

@@ -40,7 +40,6 @@ declare global {
   const ref: typeof import('vue')['ref']
   const required: typeof import('@/utils/formRules')['required']
   const resolveComponent: typeof import('vue')['resolveComponent']
-  const resolveDirective: typeof import('vue')['resolveDirective']
   const shallowReactive: typeof import('vue')['shallowReactive']
   const shallowReadonly: typeof import('vue')['shallowReadonly']
   const shallowRef: typeof import('vue')['shallowRef']
@@ -65,3 +64,8 @@ declare global {
   const watchPostEffect: typeof import('vue')['watchPostEffect']
   const watchSyncEffect: typeof import('vue')['watchSyncEffect']
 }
+// for type re-export
+declare global {
+  // @ts-ignore
+  export type { Component,ComponentPublicInstance,ComputedRef,InjectionKey,PropType,Ref,VNode } from 'vue'
+}

+ 2 - 4
src/views/system/post/form.vue

@@ -61,7 +61,7 @@ const openModal = async (type: string, id?: number) => {
   }
   modelLoading.value = false
 }
-defineExpose({ openModal: openModal }) // 提供 openModal 方法,用于打开弹窗
+defineExpose({ openModal }) // 提供 openModal 方法,用于打开弹窗
 
 // 提交新增/修改的表单
 const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
@@ -70,9 +70,7 @@ const submitForm = async () => {
   const elForm = unref(formRef)?.getElFormRef()
   if (!elForm) return
   const valid = await elForm.validate()
-  if (!valid) {
-    return
-  }
+  if (!valid) return
   // 提交请求
   actionLoading.value = true
   try {