chore(projects): merge main to example

This commit is contained in:
Soybean 2024-05-24 02:28:43 +08:00
commit 53a8e5678a
15 changed files with 41 additions and 14 deletions

View File

@ -1,6 +1,22 @@
# Changelog # Changelog
## [v1.1.2](https://github.com/soybeanjs/soybean-admin/compare/v1.1.1...v1.1.2) (2024-05-24)
###    🐞 Bug Fixes
- **projects**:
- fix header style & fix button highlight when click global-tab. fixed #446 &nbsp;-&nbsp; by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/446 [<samp>(64fc0)</samp>](https://github.com/soybeanjs/soybean-admin/commit/64fc099)
- fix multi tab page only render once. fixed #441 &nbsp;-&nbsp; by @honghuangdc in https://github.com/soybeanjs/soybean-admin/issues/441 [<samp>(e379d)</samp>](https://github.com/soybeanjs/soybean-admin/commit/e379d6c)
### &nbsp;&nbsp;&nbsp;🛠 Optimizations
- **projects**: optimize code &nbsp;-&nbsp; by @honghuangdc [<samp>(bc8dc)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bc8dc47)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![honghuangdc](https://github.com/honghuangdc.png?size=48)](https://github.com/honghuangdc)&nbsp;&nbsp;
## [v1.1.1](https://github.com/soybeanjs/soybean-admin/compare/v1.1.0...v1.1.1) (2024-05-20) ## [v1.1.1](https://github.com/soybeanjs/soybean-admin/compare/v1.1.0...v1.1.1) (2024-05-20)
### &nbsp;&nbsp;&nbsp;🚀 Features ### &nbsp;&nbsp;&nbsp;🚀 Features

View File

@ -1,7 +1,7 @@
{ {
"name": "soybean-admin", "name": "soybean-admin",
"type": "module", "type": "module",
"version": "1.1.1", "version": "1.1.2",
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。", "description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
"author": { "author": {
"name": "Soybean", "name": "Soybean",

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/axios", "name": "@sa/axios",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/color", "name": "@sa/color",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/hooks", "name": "@sa/hooks",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/materials", "name": "@sa/materials",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/fetch", "name": "@sa/fetch",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/scripts", "name": "@sa/scripts",
"version": "1.1.1", "version": "1.1.2",
"bin": { "bin": {
"sa": "./bin.ts" "sa": "./bin.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/uno-preset", "name": "@sa/uno-preset",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -1,6 +1,6 @@
{ {
"name": "@sa/utils", "name": "@sa/utils",
"version": "1.1.1", "version": "1.1.2",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@ -3,6 +3,7 @@ import { computed } from 'vue';
import { useAppStore } from '@/store/modules/app'; import { useAppStore } from '@/store/modules/app';
import { useThemeStore } from '@/store/modules/theme'; import { useThemeStore } from '@/store/modules/theme';
import { useRouteStore } from '@/store/modules/route'; import { useRouteStore } from '@/store/modules/route';
import { useTabStore } from '@/store/modules/tab';
defineOptions({ defineOptions({
name: 'GlobalContent' name: 'GlobalContent'
@ -20,6 +21,7 @@ withDefaults(defineProps<Props>(), {
const appStore = useAppStore(); const appStore = useAppStore();
const themeStore = useThemeStore(); const themeStore = useThemeStore();
const routeStore = useRouteStore(); const routeStore = useRouteStore();
const tabStore = useTabStore();
const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : '')); const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : ''));
</script> </script>
@ -36,7 +38,7 @@ const transitionName = computed(() => (themeStore.page.animate ? themeStore.page
<component <component
:is="Component" :is="Component"
v-if="appStore.reloadFlag" v-if="appStore.reloadFlag"
:key="route.path" :key="tabStore.getTabIdByRoute(route)"
:class="{ 'p-16px': showPadding }" :class="{ 'p-16px': showPadding }"
class="flex-grow bg-layout transition-300" class="flex-grow bg-layout transition-300"
/> />

View File

@ -47,7 +47,7 @@ const headerMenus = computed(() => {
</script> </script>
<template> <template>
<DarkModeContainer class="h-full flex-y-center shadow-header"> <DarkModeContainer class="h-full flex-y-center px-12px shadow-header">
<GlobalLogo v-if="showLogo" class="h-full" :style="{ width: themeStore.sider.width + 'px' }" /> <GlobalLogo v-if="showLogo" class="h-full" :style="{ width: themeStore.sider.width + 'px' }" />
<HorizontalMenu v-if="showMenu" mode="horizontal" :menus="headerMenus" class="px-12px" /> <HorizontalMenu v-if="showMenu" mode="horizontal" :menus="headerMenus" class="px-12px" />
<div v-else class="h-full flex-y-center flex-1-hidden"> <div v-else class="h-full flex-y-center flex-1-hidden">

View File

@ -141,6 +141,10 @@ function init() {
tabStore.initTabStore(route); tabStore.initTabStore(route);
} }
function removeFocus() {
(document.activeElement as HTMLElement)?.blur();
}
// watch // watch
watch( watch(
() => route.fullPath, () => route.fullPath,
@ -162,7 +166,11 @@ init();
<template> <template>
<DarkModeContainer class="size-full flex-y-center px-16px shadow-tab"> <DarkModeContainer class="size-full flex-y-center px-16px shadow-tab">
<div ref="bsWrapper" class="h-full flex-1-hidden"> <div ref="bsWrapper" class="h-full flex-1-hidden">
<BetterScroll ref="bsScroll" :options="{ scrollX: true, scrollY: false, click: appStore.isMobile }"> <BetterScroll
ref="bsScroll"
:options="{ scrollX: true, scrollY: false, click: appStore.isMobile }"
@click="removeFocus"
>
<div <div
ref="tabRef" ref="tabRef"
class="h-full flex pr-18px" class="h-full flex pr-18px"

View File

@ -17,6 +17,7 @@ import {
getDefaultHomeTab, getDefaultHomeTab,
getFixedTabIds, getFixedTabIds,
getTabByRoute, getTabByRoute,
getTabIdByRoute,
isTabInTabs, isTabInTabs,
updateTabByI18nKey, updateTabByI18nKey,
updateTabsByI18nKey updateTabsByI18nKey
@ -288,6 +289,7 @@ export const useTabStore = defineStore(SetupStoreId.Tab, () => {
setTabLabel, setTabLabel,
resetTabLabel, resetTabLabel,
isTabRetain, isTabRetain,
updateTabsByLocale updateTabsByLocale,
getTabIdByRoute
}; };
}); });

View File

@ -374,7 +374,6 @@ watch(
</NFormItemGi> </NFormItemGi>
<NFormItemGi span="24 m:12" :label="$t('page.manage.menu.hideInMenu')" path="hideInMenu"> <NFormItemGi span="24 m:12" :label="$t('page.manage.menu.hideInMenu')" path="hideInMenu">
<NRadioGroup v-model:value="model.hideInMenu"> <NRadioGroup v-model:value="model.hideInMenu">
<!-- eslint-disable-next-line vue/prefer-true-attribute-shorthand -->
<NRadio :value="true" :label="$t('common.yesOrNo.yes')" /> <NRadio :value="true" :label="$t('common.yesOrNo.yes')" />
<NRadio :value="false" :label="$t('common.yesOrNo.no')" /> <NRadio :value="false" :label="$t('common.yesOrNo.no')" />
</NRadioGroup> </NRadioGroup>