style: eslint code

This commit is contained in:
xiaoxian521
2021-08-30 20:58:32 +08:00
parent a2b200f5f2
commit e85f36b76e
6 changed files with 38 additions and 52 deletions

View File

@@ -14,20 +14,12 @@
</template>
<script lang="ts">
import {
ref,
unref,
computed,
defineComponent,
onBeforeMount,
getCurrentInstance
} from "vue";
import { ref, unref, computed, defineComponent, getCurrentInstance } from "vue";
import { useRoute } from "vue-router";
import { useSettingStoreHook } from "/@/store/modules/settings";
export default defineComponent({
name: "appMain",
setup() {
let vm: any;
const keepAlive: Boolean = ref(
getCurrentInstance().appContext.config.globalProperties.$config?.keepAlive
);

View File

@@ -20,7 +20,11 @@
>
<img :src="currentLocale ? ch : en" />
</div>
<i class="el-icon-setting hsset" :title="$t('message.hssystemSet')" @click="onPanel"></i>
<i
class="el-icon-setting hsset"
:title="$t('message.hssystemSet')"
@click="onPanel"
></i>
<!-- 退出登陆 -->
<el-dropdown trigger="click">
<span class="el-dropdown-link">
@@ -29,10 +33,9 @@
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
icon="el-icon-switch-button"
@click="logout"
>{{ $t("message.hsLoginOut") }}</el-dropdown-item>
<el-dropdown-item icon="el-icon-switch-button" @click="logout">
{{ $t("message.hsLoginOut") }}
</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@@ -68,6 +71,7 @@ export default defineComponent({
Hamburger,
screenfull
},
// @ts-ignore
computed: {
// eslint-disable-next-line vue/return-in-computed-property
currentLocale() {

View File

@@ -14,7 +14,9 @@
@mouseenter.prevent="onMouseenter(item, index)"
@mouseleave.prevent="onMouseleave(item, index)"
>
<router-link :to="item.path" @click="tagOnClick(item)">{{ $t(item.meta.title) }}</router-link>
<router-link :to="item.path" @click="tagOnClick(item)">
{{ $t(item.meta.title) }}
</router-link>
<span
v-if="
($route.path === item.path && index !== 0) ||
@@ -38,7 +40,11 @@
:style="{ left: buttonLeft + 'px', top: buttonTop + 'px' }"
class="contextmenu"
>
<div v-for="(item, key) in tagsViews" :key="key" style="display: flex; align-items: center">
<div
v-for="(item, key) in tagsViews"
:key="key"
style="display: flex; align-items: center"
>
<li v-if="item.show" @click="selectTag(item, key)">
<component :is="item.icon" :key="key" />
{{ item.text }}
@@ -131,6 +137,7 @@ export default {
!this.$storage.routesInStorage ||
this.$storage.routesInStorage.length === 0
) {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.$storage.routesInStorage = routerArrays;
}
return this.$storage.routesInStorage;
@@ -272,9 +279,6 @@ export default {
if (tag === "other") {
spliceRoute(1, 1, true);
// Array.from([2]).forEach(v => {
// tagsViews.value[v].disabled = true;
// });
} else if (tag === "left") {
spliceRoute(1, valueIndex - 1);
} else if (tag === "right") {
@@ -296,14 +300,6 @@ export default {
}
function deleteMenu(item, tag?: string) {
// if (routerArrays.length === 2) {
// Array.from([1, 2, 3]).forEach(v => {
// tagsViews.value[v].disabled = true;
// });
// }
// if (routerArrays.length === 3) {
// tagsViews.value[2].disabled = true;
// }
deleteDynamicTag(item, route.path, tag);
}
@@ -442,6 +438,7 @@ export default {
// 右键菜单不匹配当前路由,隐藏刷新
tagsViews.value[0].show = false;
showMenuModel(tag.path);
// eslint-disable-next-line no-dupe-else-if
} else if (st.routesInStorage.length === 2 && route.path !== tag.path) {
showMenus(true);
// 只有两个标签时不显示关闭其他标签页