style(projects): sort defineProps, defineEmits with TS type

This commit is contained in:
Soybean
2024-01-25 23:24:35 +08:00
parent b2c61f0306
commit 123fd4f96c
25 changed files with 100 additions and 97 deletions

View File

@ -28,15 +28,13 @@ const props = withDefaults(defineProps<AdminLayoutProps>(), {
rightFooter: false
});
const emit = defineEmits<Emits>();
const slots = defineSlots<Slots>();
interface Emits {
/** Update siderCollapse */
(e: 'update:siderCollapse', collapse: boolean): void;
}
const emit = defineEmits<Emits>();
type SlotFn = (props?: Record<string, unknown>) => any;
type Slots = {
@ -51,6 +49,9 @@ type Slots = {
/** Footer */
footer?: SlotFn;
};
const slots = defineSlots<Slots>();
const cssVars = computed(() => createLayoutCssVars(props));
// config visible

View File

@ -8,8 +8,6 @@ defineOptions({
defineProps<PageTabProps>();
defineSlots<Slots>();
type SlotFn = (props?: Record<string, unknown>) => any;
type Slots = {
@ -32,6 +30,8 @@ type Slots = {
*/
suffix?: SlotFn;
};
defineSlots<Slots>();
</script>
<template>

View File

@ -9,8 +9,6 @@ defineOptions({
defineProps<PageTabProps>();
defineSlots<Slots>();
type SlotFn = (props?: Record<string, unknown>) => any;
type Slots = {
@ -33,6 +31,8 @@ type Slots = {
*/
suffix?: SlotFn;
};
defineSlots<Slots>();
</script>
<template>

View File

@ -19,14 +19,12 @@ const props = withDefaults(defineProps<PageTabProps>(), {
closable: true
});
const emit = defineEmits<Emits>();
defineSlots<Slots>();
interface Emits {
(e: 'close'): void;
}
const emit = defineEmits<Emits>();
type SlotFn = (props?: Record<string, unknown>) => any;
type Slots = {
@ -50,6 +48,8 @@ type Slots = {
suffix?: SlotFn;
};
defineSlots<Slots>();
const activeTabComponent = computed(() => {
const { mode, chromeClass, buttonClass } = props;