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
## [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)
### &nbsp;&nbsp;&nbsp;🚀 Features

View File

@ -1,7 +1,7 @@
{
"name": "soybean-admin",
"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的清新优雅的中后台模版。",
"author": {
"name": "Soybean",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -47,7 +47,7 @@ const headerMenus = computed(() => {
</script>
<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' }" />
<HorizontalMenu v-if="showMenu" mode="horizontal" :menus="headerMenus" class="px-12px" />
<div v-else class="h-full flex-y-center flex-1-hidden">

View File

@ -141,6 +141,10 @@ function init() {
tabStore.initTabStore(route);
}
function removeFocus() {
(document.activeElement as HTMLElement)?.blur();
}
// watch
watch(
() => route.fullPath,
@ -162,7 +166,11 @@ init();
<template>
<DarkModeContainer class="size-full flex-y-center px-16px shadow-tab">
<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
ref="tabRef"
class="h-full flex pr-18px"

View File

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

View File

@ -374,7 +374,6 @@ watch(
</NFormItemGi>
<NFormItemGi span="24 m:12" :label="$t('page.manage.menu.hideInMenu')" path="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="false" :label="$t('common.yesOrNo.no')" />
</NRadioGroup>