chore: prettier & lint

Former-commit-id: 486f65e137348f400d7b95067bd3cd5a2f23ff44
This commit is contained in:
Jachin
2023-08-04 17:50:25 +08:00
parent a240ff04d2
commit f797606c44
72 changed files with 1234 additions and 484 deletions

View File

@@ -1,9 +1,10 @@
<script lang="ts" setup>
import { computed } from 'vue';
import { isExternal } from '@/utils/index';
import { useRouter } from 'vue-router';
import { computed } from "vue";
import { isExternal } from "@/utils/index";
import { useRouter } from "vue-router";
import { useAppStore } from "@/store/modules/app";
import { useAppStore } from '@/store/modules/app';
const appStore = useAppStore();
const sidebar = computed(() => appStore.sidebar);
@@ -12,16 +13,16 @@ const device = computed(() => appStore.device);
const props = defineProps({
to: {
type: String,
required: true
}
required: true,
},
});
const router = useRouter();
function push() {
if (device.value === 'mobile' && sidebar.value.opened == true) {
if (device.value === "mobile" && sidebar.value.opened == true) {
appStore.closeSideBar(false);
}
router.push(props.to).catch(err => {
router.push(props.to).catch((err) => {
console.error(err);
});
}
@@ -29,9 +30,9 @@ function push() {
<template>
<a v-if="isExternal(to)" :href="to" target="_blank" rel="noopener">
<slot />
<slot></slot>
</a>
<div v-else @click="push">
<slot />
<slot></slot>
</div>
</template>