mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-12-22 11:46:36 +08:00
parent
55e639b360
commit
be4cf0818a
|
@ -17,7 +17,7 @@
|
|||
"defineProps": "readonly",
|
||||
"defineEmits": "readonly"
|
||||
},
|
||||
"plugins": ["vue", "@typescript-eslint", "simple-import-sort"],
|
||||
"plugins": ["vue", "@typescript-eslint","import"],
|
||||
"parserOptions": {
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"sourceType": "module",
|
||||
|
@ -38,6 +38,7 @@
|
|||
"no-shadow": "off",
|
||||
"guard-for-in": "off",
|
||||
|
||||
"import/order": "error",
|
||||
"import/extensions": "off",
|
||||
"import/no-unresolved": "off",
|
||||
"import/no-extraneous-dependencies": "off",
|
||||
|
@ -66,8 +67,6 @@
|
|||
"@typescript-eslint/ban-ts-comment": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"class-methods-use-this": "off", // 因为AxiosCancel必须实例化而能静态化所以加的规则,如果有办法解决可以取消
|
||||
"simple-import-sort/imports": "error",
|
||||
"simple-import-sort/exports": "error"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
|
|
|
@ -53,9 +53,8 @@
|
|||
"eslint": "^8.45.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-config-prettier": "^8.9.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-import": "^2.28.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||
"eslint-plugin-vue": "^9.15.1",
|
||||
"eslint-plugin-vue-scoped-css": "^2.5.0",
|
||||
"husky": "^8.0.3",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable simple-import-sort/imports */
|
||||
import TDesign from 'tdesign-vue-next';
|
||||
import { createApp } from 'vue';
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
import uniq from 'lodash/uniq';
|
||||
import { createRouter, createWebHistory, RouteRecordRaw, useRoute } from 'vue-router';
|
||||
|
||||
import { useSettingStore } from '@/store';
|
||||
|
||||
const env = import.meta.env.MODE || 'development';
|
||||
|
||||
// 导入homepage相关固定路由
|
||||
|
@ -60,9 +62,16 @@ export const getRoutesExpanded = () => {
|
|||
|
||||
export const getActive = (maxLevel = 3): string => {
|
||||
const route = useRoute();
|
||||
const settingStore = useSettingStore();
|
||||
|
||||
if (!route.path) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (settingStore.layout === 'top') {
|
||||
return route.path.split('/').slice(0, 2).join('/');
|
||||
}
|
||||
|
||||
return route.path
|
||||
.split('/')
|
||||
.filter((_item: string, index: number) => index <= maxLevel && index > 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import path from 'path';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import path from 'path';
|
||||
import { ConfigEnv, loadEnv, UserConfig } from 'vite';
|
||||
import { viteMockServe } from 'vite-plugin-mock';
|
||||
import svgLoader from 'vite-svg-loader';
|
||||
|
|
Loading…
Reference in New Issue
Block a user