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