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

@ -6,12 +6,6 @@ defineOptions({
name: 'LangSwitch'
});
const props = withDefaults(defineProps<Props>(), {
showTooltip: true
});
const emit = defineEmits<Emits>();
interface Props {
/** Current language */
lang: App.I18n.LangType;
@ -21,10 +15,16 @@ interface Props {
showTooltip?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
showTooltip: true
});
type Emits = {
(e: 'changeLang', lang: App.I18n.LangType): void;
};
const emit = defineEmits<Emits>();
const tooltipContent = computed(() => {
if (!props.showTooltip) return '';