Skip to content

Commit

Permalink
refactor: 使用@/别名替换/@/别名
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Oct 27, 2022
1 parent 6ceb376 commit 7d419c3
Show file tree
Hide file tree
Showing 50 changed files with 153 additions and 158 deletions.
2 changes: 1 addition & 1 deletion build/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import VueI18n from "@intlify/vite-plugin-vue-i18n";
import { visualizer } from "rollup-plugin-visualizer";
import removeConsole from "vite-plugin-remove-console";
import themePreprocessorPlugin from "@pureadmin/theme";
import { genScssMultipleScopeVars } from "/@/layout/theme";
import DefineOptions from "unplugin-vue-define-options/vite";
import { genScssMultipleScopeVars } from "../src/layout/theme";

export function getPluginsList(
command: string,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReAuth/src/auth.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent, Fragment } from "vue";
import { hasAuth } from "/@/router/utils";
import { hasAuth } from "@/router/utils";

export default defineComponent({
name: "Auth",
Expand Down
2 changes: 1 addition & 1 deletion src/directives/auth/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { hasAuth } from "/@/router/utils";
import { hasAuth } from "@/router/utils";
import { Directive, type DirectiveBinding } from "vue";

export const auth: Directive = {
Expand Down
2 changes: 1 addition & 1 deletion src/directives/elResizeDetector/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Directive, type DirectiveBinding, type VNode } from "vue";
import elementResizeDetectorMaker from "element-resize-detector";
import type { Erd } from "element-resize-detector";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";

const erd: Erd = elementResizeDetectorMaker({
strategy: "scroll"
Expand Down
4 changes: 2 additions & 2 deletions src/layout/components/appMain.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { useGlobal } from "@pureadmin/utils";
import backTop from "/@/assets/svg/back_top.svg?component";
import backTop from "@/assets/svg/back_top.svg?component";
import { h, computed, Transition, defineComponent } from "vue";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { usePermissionStoreHook } from "@/store/modules/permission";
const props = defineProps({
fixedHeader: Boolean
Expand Down
6 changes: 3 additions & 3 deletions src/layout/components/navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import Search from "./search/index.vue";
import Notice from "./notice/index.vue";
import mixNav from "./sidebar/mixNav.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import avatars from "@/assets/avatars.jpg";
import { useNav } from "@/layout/hooks/useNav";
import Breadcrumb from "./sidebar/breadCrumb.vue";
import topCollapse from "./sidebar/topCollapse.vue";
import { useTranslationLang } from "../hooks/useTranslationLang";
import globalization from "/@/assets/svg/globalization.svg?component";
import globalization from "@/assets/svg/globalization.svg?component";
const {
layout,
Expand Down
2 changes: 1 addition & 1 deletion src/layout/components/panel/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from "vue";
import { onClickOutside } from "@vueuse/core";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
let show = ref<Boolean>(false);
const target = ref(null);
Expand Down
4 changes: 2 additions & 2 deletions src/layout/components/search/components/SearchFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</template>

<script lang="ts" setup>
import enterOutlined from "/@/assets/svg/enter_outlined.svg?component";
import mdiKeyboardEsc from "/@/assets/svg/mdi_keyboard_esc.svg?component";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
import mdiKeyboardEsc from "@/assets/svg/mdi_keyboard_esc.svg?component";
</script>
<style lang="scss" scoped>
.search-footer {
Expand Down
6 changes: 3 additions & 3 deletions src/layout/components/search/components/SearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { useRouter } from "vue-router";
import { cloneDeep } from "lodash-unified";
import SearchResult from "./SearchResult.vue";
import SearchFooter from "./SearchFooter.vue";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n";
import { deleteChildren } from "@pureadmin/utils";
import { useDebounceFn, onKeyStroke } from "@vueuse/core";
import { ref, watch, computed, nextTick, shallowRef } from "vue";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { usePermissionStoreHook } from "@/store/modules/permission";
interface Props {
/** 弹窗显隐 */
Expand Down
6 changes: 3 additions & 3 deletions src/layout/components/search/components/SearchResult.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import enterOutlined from "/@/assets/svg/enter_outlined.svg?component";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import enterOutlined from "@/assets/svg/enter_outlined.svg?component";
const { t } = useI18n();
Expand Down
22 changes: 11 additions & 11 deletions src/layout/components/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import {
nextTick,
useCssModule
} from "vue";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { useRouter } from "vue-router";
import panel from "../panel/index.vue";
import { emitter } from "/@/utils/mitt";
import { resetRouter } from "/@/router";
import { emitter } from "@/utils/mitt";
import { resetRouter } from "@/router";
import { templateRef } from "@vueuse/core";
import { removeToken } from "/@/utils/auth";
import { routerArrays } from "/@/layout/types";
import { useNav } from "/@/layout/hooks/useNav";
import { useAppStoreHook } from "/@/store/modules/app";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { useDataThemeChange } from "/@/layout/hooks/useDataThemeChange";
import { removeToken } from "@/utils/auth";
import { routerArrays } from "@/layout/types";
import { useNav } from "@/layout/hooks/useNav";
import { useAppStoreHook } from "@/store/modules/app";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
import {
useDark,
debounce,
Expand All @@ -29,8 +29,8 @@ import {
} from "@pureadmin/utils";
import { toggleTheme } from "@pureadmin/theme/dist/browser-utils";
import dayIcon from "/@/assets/svg/day.svg?component";
import darkIcon from "/@/assets/svg/dark.svg?component";
import dayIcon from "@/assets/svg/day.svg?component";
import darkIcon from "@/assets/svg/dark.svg?component";
const router = useRouter();
const { device } = useNav();
Expand Down
6 changes: 3 additions & 3 deletions src/layout/components/sidebar/breadCrumb.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { isEqual } from "lodash-unified";
import { transformI18n } from "/@/plugins/i18n";
import { transformI18n } from "@/plugins/i18n";
import { ref, watch, onMounted, toRaw } from "vue";
import { getParentPaths, findRouteByPath } from "/@/router/utils";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { getParentPaths, findRouteByPath } from "@/router/utils";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useRoute, useRouter, RouteLocationMatched } from "vue-router";
const route = useRoute();
Expand Down
8 changes: 4 additions & 4 deletions src/layout/components/sidebar/horizontal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Search from "../search/index.vue";
import Notice from "../notice/index.vue";
import { ref, watch, nextTick } from "vue";
import SidebarItem from "./sidebarItem.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import avatars from "@/assets/avatars.jpg";
import { useNav } from "@/layout/hooks/useNav";
import { useTranslationLang } from "../../hooks/useTranslationLang";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import globalization from "/@/assets/svg/globalization.svg?component";
import { usePermissionStoreHook } from "@/store/modules/permission";
import globalization from "@/assets/svg/globalization.svg?component";
const menuRef = ref();
Expand Down
2 changes: 1 addition & 1 deletion src/layout/components/sidebar/logo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { useNav } from "/@/layout/hooks/useNav";
import { useNav } from "@/layout/hooks/useNav";
const props = defineProps({
collapse: Boolean
Expand Down
14 changes: 7 additions & 7 deletions src/layout/components/sidebar/mixNav.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script setup lang="ts">
import Search from "../search/index.vue";
import Notice from "../notice/index.vue";
import avatars from "/@/assets/avatars.jpg";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import avatars from "@/assets/avatars.jpg";
import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n";
import { ref, toRaw, watch, onMounted, nextTick } from "vue";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { getParentPaths, findRouteByPath } from "/@/router/utils";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { getParentPaths, findRouteByPath } from "@/router/utils";
import { useTranslationLang } from "../../hooks/useTranslationLang";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import globalization from "/@/assets/svg/globalization.svg?component";
import { usePermissionStoreHook } from "@/store/modules/permission";
import globalization from "@/assets/svg/globalization.svg?component";
const menuRef = ref();
let defaultActive = ref(null);
Expand Down
6 changes: 3 additions & 3 deletions src/layout/components/sidebar/sidebarItem.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import path from "path";
import { childrenType } from "../../types";
import { useNav } from "/@/layout/hooks/useNav";
import { transformI18n } from "/@/plugins/i18n";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { useNav } from "@/layout/hooks/useNav";
import { transformI18n } from "@/plugins/i18n";
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
import { ref, toRaw, PropType, nextTick, computed, CSSProperties } from "vue";
const { layout, isCollapse } = useNav();
Expand Down
8 changes: 4 additions & 4 deletions src/layout/components/sidebar/vertical.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<script setup lang="ts">
import Logo from "./logo.vue";
import { useRoute } from "vue-router";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
import SidebarItem from "./sidebarItem.vue";
import leftCollapse from "./leftCollapse.vue";
import type { StorageConfigs } from "/#/index";
import { useNav } from "/@/layout/hooks/useNav";
import { useNav } from "@/layout/hooks/useNav";
import { storageLocal } from "@pureadmin/utils";
import { ref, computed, watch, onBeforeMount } from "vue";
import { findRouteByPath, getParentPaths } from "/@/router/utils";
import { usePermissionStoreHook } from "/@/store/modules/permission";
import { findRouteByPath, getParentPaths } from "@/router/utils";
import { usePermissionStoreHook } from "@/store/modules/permission";
const route = useRoute();
const showLogo = ref(
Expand Down
12 changes: 6 additions & 6 deletions src/layout/components/tag/index.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { $t } from "/@/plugins/i18n";
import { emitter } from "/@/utils/mitt";
import { $t } from "@/plugins/i18n";
import { emitter } from "@/utils/mitt";
import { RouteConfigs } from "../../types";
import { useTags } from "../../hooks/useTag";
import { routerArrays } from "/@/layout/types";
import { routerArrays } from "@/layout/types";
import { isEqual, isEmpty } from "lodash-unified";
import { useSettingStoreHook } from "/@/store/modules/settings";
import { useSettingStoreHook } from "@/store/modules/settings";
import { ref, watch, unref, nextTick, onBeforeMount } from "vue";
import { handleAliveRoute, delAliveRoutes } from "/@/router/utils";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { handleAliveRoute, delAliveRoutes } from "@/router/utils";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { useResizeObserver, useDebounceFn, useFullscreen } from "@vueuse/core";
const {
Expand Down
4 changes: 2 additions & 2 deletions src/layout/hooks/useDataThemeChange.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ref } from "vue";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { find } from "lodash-unified";
import { useLayout } from "./useLayout";
import { themeColorsType } from "../types";
import { TinyColor } from "@ctrl/tinycolor";
import { useGlobal } from "@pureadmin/utils";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import {
darken,
lighten,
Expand Down
2 changes: 1 addition & 1 deletion src/layout/hooks/useLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { routerArrays } from "../types";
import { useGlobal } from "@pureadmin/utils";
import { useMultiTagsStore } from "/@/store/modules/multiTags";
import { useMultiTagsStore } from "@/store/modules/multiTags";

export function useLayout() {
const { $storage, $config } = useGlobal<GlobalPropertiesApi>();
Expand Down
14 changes: 7 additions & 7 deletions src/layout/hooks/useNav.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { computed } from "vue";
import { getConfig } from "/@/config";
import { getConfig } from "@/config";
import { useRouter } from "vue-router";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
import { routeMetaType } from "../types";
import { useGlobal } from "@pureadmin/utils";
import { transformI18n } from "/@/plugins/i18n";
import { router, remainingPaths } from "/@/router";
import { useAppStoreHook } from "/@/store/modules/app";
import { useUserStoreHook } from "/@/store/modules/user";
import { useEpThemeStoreHook } from "/@/store/modules/epTheme";
import { transformI18n } from "@/plugins/i18n";
import { router, remainingPaths } from "@/router";
import { useAppStoreHook } from "@/store/modules/app";
import { useUserStoreHook } from "@/store/modules/user";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";

const errorInfo = "当前路由配置不正确,请检查配置";

Expand Down
6 changes: 3 additions & 3 deletions src/layout/hooks/useTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { isEqual } from "lodash-unified";
import type { StorageConfigs } from "/#/index";
import { useEventListener } from "@vueuse/core";
import { useRoute, useRouter } from "vue-router";
import { transformI18n, $t } from "/@/plugins/i18n";
import { useSettingStoreHook } from "/@/store/modules/settings";
import { useMultiTagsStoreHook } from "/@/store/modules/multiTags";
import { transformI18n, $t } from "@/plugins/i18n";
import { useSettingStoreHook } from "@/store/modules/settings";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { storageLocal, toggleClass, hasClass } from "@pureadmin/utils";

export function useTags() {
Expand Down
8 changes: 4 additions & 4 deletions src/layout/index.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { setType } from "./types";
import { emitter } from "/@/utils/mitt";
import { emitter } from "@/utils/mitt";
import { useLayout } from "./hooks/useLayout";
import { useAppStoreHook } from "/@/store/modules/app";
import { useSettingStoreHook } from "/@/store/modules/settings";
import { useAppStoreHook } from "@/store/modules/app";
import { useSettingStoreHook } from "@/store/modules/settings";
import { deviceDetection, useDark, useGlobal } from "@pureadmin/utils";
import { h, reactive, computed, onMounted, defineComponent } from "vue";
Expand All @@ -13,7 +13,7 @@ import appMain from "./components/appMain.vue";
import setting from "./components/setting/index.vue";
import Vertical from "./components/sidebar/vertical.vue";
import Horizontal from "./components/sidebar/horizontal.vue";
import backTop from "/@/assets/svg/back_top.svg?component";
import backTop from "@/assets/svg/back_top.svg?component";
const { isDark } = useDark();
const { layout } = useLayout();
Expand Down
14 changes: 7 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import App from "./App.vue";
import router from "./router";
import { setupStore } from "/@/store";
import { setupStore } from "@/store";
import ElementPlus from "element-plus";
import { useI18n } from "@/plugins/i18n";
import { getServerConfig } from "./config";
import { createApp, Directive } from "vue";
import { useI18n } from "../src/plugins/i18n";
import { MotionPlugin } from "@vueuse/motion";
// import { useEcharts } from "/@/plugins/echarts";
// import { useTable } from "../src/plugins/vxe-table";
import { injectResponsiveStorage } from "/@/utils/responsive";
// import { useEcharts } from "@/plugins/echarts";
// import { useTable } from "@/plugins/vxe-table";
import { injectResponsiveStorage } from "@/utils/responsive";

// import Table from "@pureadmin/table";
// import PureDescriptions from "@pureadmin/descriptions";
Expand All @@ -29,7 +29,7 @@ import "./assets/iconfont/iconfont.css";
const app = createApp(App);

// 自定义指令
import * as directives from "/@/directives";
import * as directives from "@/directives";
Object.keys(directives).forEach(key => {
app.directive(key, (directives as { [key: string]: Directive })[key]);
});
Expand All @@ -45,7 +45,7 @@ app.component("IconifyIconOnline", IconifyIconOnline);
app.component("FontIcon", FontIcon);

// 全局注册按钮级别权限组件
import { Auth } from "/@/components/ReAuth";
import { Auth } from "@/components/ReAuth";
app.component("Auth", Auth);

getServerConfig(app).then(async config => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vxe-table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import "xe-utils";
import "./index.scss";
import XEUtils from "xe-utils";
import { App, unref } from "vue";
import { i18n } from "/@/plugins/i18n";
import { i18n } from "@/plugins/i18n";
import "font-awesome/css/font-awesome.min.css";
import zh from "vxe-table/lib/locale/lang/zh-CN";
import en from "vxe-table/lib/locale/lang/en-US";
Expand Down
Loading

0 comments on commit 7d419c3

Please sign in to comment.