style(projects): update prettier config

This commit is contained in:
Soybean
2022-04-01 14:47:57 +08:00
parent ca2dfa6185
commit df56abe18d
128 changed files with 2237 additions and 2037 deletions

View File

@ -21,21 +21,21 @@ export const useTabStore = defineStore('tab-store', {
name: 'root',
path: '/',
meta: {
title: 'root',
title: 'root'
},
scrollPosition: {
left: 0,
top: 0,
},
top: 0
}
},
activeTab: '',
activeTab: ''
}),
getters: {
/** 当前激活状态的页签索引 */
activeTabIndex(state) {
const { tabs, activeTab } = state;
return tabs.findIndex((tab) => tab.path === activeTab);
},
return tabs.findIndex(tab => tab.path === activeTab);
}
},
actions: {
/**
@ -52,7 +52,7 @@ export const useTabStore = defineStore('tab-store', {
*/
initHomeTab(routeHomeName: string, router: Router) {
const routes = router.getRoutes();
const findHome = routes.find((item) => item.name === routeHomeName);
const findHome = routes.find(item => item.name === routeHomeName);
if (findHome) {
this.homeTab = getTabRouteByVueRoute(findHome);
}
@ -74,7 +74,7 @@ export const useTabStore = defineStore('tab-store', {
const { routerPush } = useRouterPush(false);
const isActive = this.activeTab === path;
const updateTabs = this.tabs.filter((tab) => tab.path !== path);
const updateTabs = this.tabs.filter(tab => tab.path !== path);
this.tabs = updateTabs;
if (isActive && updateTabs.length) {
const activePath = updateTabs[updateTabs.length - 1].path;
@ -92,7 +92,7 @@ export const useTabStore = defineStore('tab-store', {
const homePath = this.homeTab.path;
const remain = [homePath, ...excludes];
const hasActive = remain.includes(this.activeTab);
const updateTabs = this.tabs.filter((tab) => remain.includes(tab.path));
const updateTabs = this.tabs.filter(tab => remain.includes(tab.path));
this.tabs = updateTabs;
if (!hasActive && updateTabs.length) {
const activePath = updateTabs[updateTabs.length - 1].path;
@ -107,7 +107,7 @@ export const useTabStore = defineStore('tab-store', {
clearLeftTab(path: string) {
const index = getIndexInTabRoutes(this.tabs, path);
if (index > -1) {
const excludes = this.tabs.slice(index).map((item) => item.path);
const excludes = this.tabs.slice(index).map(item => item.path);
this.clearTab(excludes);
}
},
@ -118,7 +118,7 @@ export const useTabStore = defineStore('tab-store', {
clearRightTab(path: string) {
const index = getIndexInTabRoutes(this.tabs, path);
if (index > -1) {
const excludes = this.tabs.slice(0, index + 1).map((item) => item.path);
const excludes = this.tabs.slice(0, index + 1).map(item => item.path);
this.clearTab(excludes);
}
},
@ -153,7 +153,7 @@ export const useTabStore = defineStore('tab-store', {
getTabScrollPosition(path: string) {
const position = {
left: 0,
top: 0,
top: 0
};
const index = getIndexInTabRoutes(this.tabs, path);
if (index > -1) {
@ -177,6 +177,6 @@ export const useTabStore = defineStore('tab-store', {
}
this.tabs = tabs;
this.setActiveTab(currentRoute.path);
},
},
}
}
});