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

@@ -84,7 +84,7 @@ onMounted(() => {
class="inline-block w-[30px] h-[30px] cursor-pointer"
:style="{ background: color }"
@click="changeThemeColor(color)"
/>
></li>
</ul>
<el-divider>导航设置</el-divider>
@@ -98,8 +98,8 @@ onMounted(() => {
"
@click="changeLayout('left')"
>
<div />
<div />
<div></div>
<div></div>
</li>
</el-tooltip>
<el-tooltip content="顶部模式" placement="bottom">
@@ -110,8 +110,8 @@ onMounted(() => {
"
@click="changeLayout('top')"
>
<div />
<div />
<div></div>
<div></div>
</li>
</el-tooltip>
<el-tooltip content="混合模式" placement="bottom">
@@ -122,8 +122,8 @@ onMounted(() => {
"
@click="changeLayout('mix')"
>
<div />
<div />
<div></div>
<div></div>
</li>
</el-tooltip>
</ul>

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>

View File

@@ -1,13 +1,13 @@
<script lang="ts" setup>
import { useSettingsStore } from '@/store/modules/settings';
import { useSettingsStore } from "@/store/modules/settings";
const settingsStore = useSettingsStore();
defineProps({
collapse: {
type: Boolean,
required: true
}
required: true,
},
});
const logo = ref(new URL(`../../../assets/logo.png`, import.meta.url).href);

View File

@@ -1,10 +1,10 @@
<script setup lang="ts">
import path from 'path-browserify';
import { isExternal } from '@/utils/index';
import AppLink from './Link.vue';
import path from "path-browserify";
import { isExternal } from "@/utils/index";
import AppLink from "./Link.vue";
import { translateRouteTitleI18n } from '@/utils/i18n';
import SvgIcon from '@/components/SvgIcon/index.vue';
import { translateRouteTitleI18n } from "@/utils/i18n";
import SvgIcon from "@/components/SvgIcon/index.vue";
const props = defineProps({
/**
@@ -12,7 +12,7 @@ const props = defineProps({
*/
item: {
type: Object,
required: true
required: true,
},
/**
@@ -20,8 +20,8 @@ const props = defineProps({
*/
basePath: {
type: String,
required: true
}
required: true,
},
});
const onlyOneChild = ref(); // 临时变量,唯一子路由
@@ -53,7 +53,7 @@ function hasOneShowingChild(children = [], parent: any) {
// 2如果无子路由, 复制当前路由信息作为其子路由,满足只拥有一个子路由的条件,所以返回 true
if (showingChildren.length === 0) {
onlyOneChild.value = { ...parent, path: '', noShowingChildren: true };
onlyOneChild.value = { ...parent, path: "", noShowingChildren: true };
return true;
}
return false;

View File

@@ -99,7 +99,7 @@ defineExpose({
:vertical="false"
@wheel.prevent="handleScroll"
>
<slot />
<slot></slot>
</el-scrollbar>
</template>

View File

@@ -1,12 +1,5 @@
<script setup lang="ts">
import {
getCurrentInstance,
nextTick,
ref,
watch,
onMounted,
ComponentInternalInstance,
} from "vue";
import { getCurrentInstance, ComponentInternalInstance } from "vue";
import { storeToRefs } from "pinia";
import path from "path-browserify";

View File

@@ -1,4 +1,4 @@
export { default as Navbar } from './Navbar.vue';
export { default as AppMain } from './AppMain.vue';
export { default as Settings } from './Settings/index.vue';
export { default as TagsView } from './TagsView/index.vue';
export { default as Navbar } from "./Navbar.vue";
export { default as AppMain } from "./AppMain.vue";
export { default as Settings } from "./Settings/index.vue";
export { default as TagsView } from "./TagsView/index.vue";