mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 代码优化
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RouterLink } from 'vue-router';
|
||||
import { routePath } from '@/router';
|
||||
import { useAppInfo } from '@/composables';
|
||||
|
||||
|
@ -49,9 +49,9 @@ const route = useRoute();
|
||||
const app = useAppStore();
|
||||
const theme = useThemeStore();
|
||||
const { routerPush } = useRouterPush();
|
||||
const { title } = useAppInfo();
|
||||
|
||||
const showDrawer = computed(() => (props.visible && props.menus.length) || app.mixSiderFixed);
|
||||
const { title } = useAppInfo();
|
||||
|
||||
const activeKey = computed(() => route.name as string);
|
||||
const expandedKeys = ref<string[]>([]);
|
||||
|
@ -3,7 +3,7 @@
|
||||
type="primary"
|
||||
:class="[{ '!right-330px': app.settingDrawerVisible }, app.settingDrawerVisible ? 'ease-out' : 'ease-in']"
|
||||
class="fixed top-240px right-14px z-10000 w-42px h-42px !p-0 transition-all duration-300"
|
||||
@click="app.toggleSettingdrawerVisible"
|
||||
@click="app.toggleSettingDrawerVisible"
|
||||
>
|
||||
<icon-ant-design-close-outlined v-if="app.settingDrawerVisible" class="text-24px" />
|
||||
<icon-ant-design-setting-outlined v-else class="text-24px" />
|
||||
|
@ -47,7 +47,7 @@ export const useAppStore = defineStore('app-store', {
|
||||
this.settingDrawerVisible = false;
|
||||
},
|
||||
/** 切换抽屉可见状态 */
|
||||
toggleSettingdrawerVisible() {
|
||||
toggleSettingDrawerVisible() {
|
||||
this.settingDrawerVisible = !this.settingDrawerVisible;
|
||||
},
|
||||
/** 设置侧边栏折叠状态 */
|
||||
|
@ -24,7 +24,7 @@ export function getLayoutComponent(layoutType: EnumType.LayoutComponentName) {
|
||||
*/
|
||||
export function getViewComponent(routeKey: AuthRoute.RouteKey) {
|
||||
if (!views[routeKey]) {
|
||||
consoleError(`该路由“${routeKey}”没有对应的组件文件!`);
|
||||
consoleError(`路由“${routeKey}”没有对应的组件文件!`);
|
||||
}
|
||||
return () => setViewComponentName(views[routeKey], routeKey) as Promise<Component>;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { RouterLink } from 'vue-router';
|
||||
import { routeName } from '@/router';
|
||||
|
||||
type ExceptionType = '403' | '404' | '500';
|
||||
|
Reference in New Issue
Block a user