diff --git a/src/components/XIcon.vue b/src/components/XIcon.vue index 40220bd..652a7f1 100644 --- a/src/components/XIcon.vue +++ b/src/components/XIcon.vue @@ -14,28 +14,35 @@ export default defineComponent({ name: 'XIcon', props: { + // 图标名称 name: { type: String, default: '', }, + // 图标尺寸 size: { type: [String, Number], default: 14, }, + // 是否为自定义SVG图标 svg: { type: Boolean, default: false, }, + // 图标颜色 color: { type: String, default: 'inherit', }, }, setup(props) { + // 自定义SVG唯一标识 const symbolId = computed(() => `#icon-${props.name}`); + // 补全图标尺寸 const size = computed(() => Number.isNaN(new Number(props.size).valueOf()) ? props.size : props.size + 'px' ); + // 判断是remix图标还是element-plus图标 const isRemix = computed(() => !Object.keys(icons).includes(props.name)); return { symbolId, diff --git a/src/configs/index.js b/src/configs/index.js index 925bf43..cb560b9 100644 --- a/src/configs/index.js +++ b/src/configs/index.js @@ -1,4 +1,14 @@ export default { + /** + * 接口请求地址前缀 + */ baseURL: import.meta.env.VITE_BASE_URL, + /** + * 接口请求超时时间 + */ requestTimeout: import.meta.env.VITE_REQUEST_TIMEOUT, + /** + * 是否使用本地路由 + */ + useLocalRouter: false, }; diff --git a/src/layouts/components/aside.vue b/src/layouts/components/aside.vue index 61c2095..f18e3c3 100644 --- a/src/layouts/components/aside.vue +++ b/src/layouts/components/aside.vue @@ -16,6 +16,7 @@ const asideList = computed(() => store.getters['layout/asideList']); const activeAside = computed(() => store.state.layout.activeAside); + // 当前激活侧边导航改变时重设菜单列表 watch( () => activeAside, (value) => { @@ -26,6 +27,7 @@ }, { immediate: true, deep: true } ); + const handleClick = (item) => { store.commit('layout/setActiveAside', item.name); }; diff --git a/src/layouts/components/header.vue b/src/layouts/components/header.vue index 22377cf..beeff27 100644 --- a/src/layouts/components/header.vue +++ b/src/layouts/components/header.vue @@ -1,7 +1,7 @@