Skip to content

Commit 89586ef

Browse files
committed
fix: Page switching display is abnormal
1 parent 16ed5a0 commit 89586ef

File tree

5 files changed

+10
-32
lines changed

5 files changed

+10
-32
lines changed

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN echo "Builder Success 🎉"
2020

2121
FROM nginx:stable-alpine as production
2222

23+
RUN echo "types { application/javascript js mjs; }" > /etc/nginx/conf.d/mjs.conf
2324
COPY --from=builder /app/apps/antd-view/dist /usr/share/nginx/html
2425

2526
COPY ./deploy/nginx.conf /etc/nginx/nginx.conf

internal/vite-config/src/plugins/license.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type {
22
NormalizedOutputOptions,
3-
OutputAsset,
43
OutputBundle,
54
OutputChunk,
65
} from 'rollup';
@@ -45,25 +44,14 @@ async function viteLicensePlugin(
4544
`.trim();
4645

4746
for (const [, fileContent] of Object.entries(bundle)) {
48-
if (
49-
fileContent.type === 'asset' ||
50-
(fileContent.type === 'chunk' && fileContent.isEntry)
51-
) {
47+
if (fileContent.type === 'chunk' && fileContent.isEntry) {
5248
const chunkContent = fileContent as OutputChunk;
53-
const assetContent = fileContent as OutputAsset;
5449
// 插入版权信息
55-
const content =
56-
typeof assetContent.source === 'string'
57-
? assetContent.source
58-
: chunkContent.code;
50+
const content = chunkContent.code;
5951
const updatedContent = `${copyrightText}${EOL}${content}`;
6052

6153
// 更新bundle
62-
if (assetContent.source === undefined) {
63-
(fileContent as OutputChunk).code = updatedContent;
64-
} else {
65-
(fileContent as OutputAsset).source = updatedContent;
66-
}
54+
(fileContent as OutputChunk).code = updatedContent;
6755
}
6856
}
6957
},

packages/business/layouts/src/basic/content/content.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ defineOptions({ name: 'LayoutContent' });
1212
1313
const { keepAlive } = usePreferences();
1414
const tabsStore = useTabsStore();
15-
const { onTransitionEnd, spinning } = useContentSpinner();
15+
const { spinning } = useContentSpinner();
1616
1717
const { getCacheTabs, getExcludeTabs, renderRouteView } =
1818
storeToRefs(tabsStore);
@@ -51,12 +51,7 @@ function getTransitionName(route: RouteLocationNormalizedLoaded) {
5151
/>
5252
<IFrameRouterView />
5353
<RouterView v-slot="{ Component, route }">
54-
<Transition
55-
:name="getTransitionName(route)"
56-
appear
57-
mode="out-in"
58-
@transitionend="onTransitionEnd"
59-
>
54+
<Transition :name="getTransitionName(route)" appear mode="out-in">
6055
<KeepAlive
6156
v-if="keepAlive"
6257
:exclude="getExcludeTabs"

packages/business/layouts/src/basic/content/use-content-spinner.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { preferences } from '@vben-core/preferences';
55

66
function useContentSpinner() {
77
const spinning = ref(false);
8-
const isStartTransition = ref(false);
98
const startTime = ref(0);
109
const router = useRouter();
1110
const minShowTime = 500;
@@ -29,7 +28,6 @@ function useContentSpinner() {
2928
if (to.meta.loaded || !enableLoading.value) {
3029
return true;
3130
}
32-
isStartTransition.value = false;
3331
startTime.value = performance.now();
3432
spinning.value = true;
3533
return true;
@@ -40,17 +38,13 @@ function useContentSpinner() {
4038
return true;
4139
}
4240

43-
// 未进入过渡动画
44-
if (!isStartTransition.value) {
45-
// 关闭加载动画
46-
onEnd();
47-
}
41+
// 关闭加载动画
42+
onEnd();
4843

49-
isStartTransition.value = false;
5044
return true;
5145
});
5246

53-
return { onTransitionEnd: onEnd, spinning };
47+
return { spinning };
5448
}
5549

5650
export { useContentSpinner };

packages/locales/src/langs/zh-CN.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ preferences:
181181
name: 动画
182182
loading: 页面切换 Loading
183183
transition: 页面切换动画
184-
progress: 页面加载进度条
184+
progress: 页面切换进度条
185185
theme:
186186
name: 主题
187187
builtin: 内置主题

0 commit comments

Comments
 (0)