From 99f8edb7295f913e36cd28c41ac4a6b536c982d9 Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sat, 23 Nov 2024 22:58:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=20eslint.config.?= =?UTF-8?q?js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.js | 4 ++++ src/components/GenCron/CronModel/index.vue | 4 ++-- src/components/GiEditTable/GiEditTable.vue | 3 +-- src/components/GiForm/src/GiForm.vue | 4 ++-- src/layout/components/HeaderRightBar/SettingDrawer.vue | 4 ++-- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index c78ff6c..3a14f5b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,6 +8,10 @@ export default antfu( 'vue/block-order': ['error', { order: [['script', 'template'], 'style'], }], // 强制组件顶级元素的顺序 + 'vue/define-macros-order': ['error', { + order: ['defineOptions', 'defineModel', 'defineProps', 'defineEmits', 'defineSlots'], + defineExposeLast: true, + }], // 强制执行定义限制和定义弹出编译器宏的顺序 'vue/singleline-html-element-content-newline': 'off', // 要求在单行元素的内容前后换行 'vue/html-self-closing': ['off', { html: { diff --git a/src/components/GenCron/CronModel/index.vue b/src/components/GenCron/CronModel/index.vue index ecb9780..9e3a090 100644 --- a/src/components/GenCron/CronModel/index.vue +++ b/src/components/GenCron/CronModel/index.vue @@ -49,8 +49,6 @@ const open = (cron: string = '') => { visible.value = true } -defineExpose({ open }) - // 确定 const handlerOk = () => { if (cronInputRef.value?.checkCron()) { @@ -65,6 +63,8 @@ const handlerOk = () => { const handlerClose = () => { visible.value = false } + +defineExpose({ open }) diff --git a/src/components/GiForm/src/GiForm.vue b/src/components/GiForm/src/GiForm.vue index 85f6ef8..1208b7d 100644 --- a/src/components/GiForm/src/GiForm.vue +++ b/src/components/GiForm/src/GiForm.vue @@ -167,8 +167,6 @@ const isDisabled = (disabled?: ColumnsItemDisabled) => { } } -defineExpose({ formRef }) - props.columns.forEach((item) => { if (item.request && typeof item.request === 'function' && item?.init) { item.request(props.modelValue).then((res) => { @@ -213,6 +211,8 @@ watch(cloneForm as any, (newVal, oldVal) => { } }) }) + +defineExpose({ formRef })