This commit is contained in:
2026-01-08 14:01:27 +08:00
parent 5190a0cc9c
commit 8e86f244c6
10 changed files with 25 additions and 32 deletions

View File

@@ -5,27 +5,13 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title>招标管理系统</title>
<!-- 引入 shared 模块的样式Module Federation 远程模块样式) -->
<link rel="stylesheet" href="/shared/assets/shared-styles.css">
<!-- 加载运行时配置(必须在其他脚本之前加载) -->
<script src="/app-config.js"></script>
<!-- <script src="/app-config.local.js"></script> -->
<!-- Import Maps 配置 - 引用共享模块 -->
<script type="importmap">
{
"imports": {
"@shared/components": "http://localhost:7000/shared/components.js",
"@shared/utils": "http://localhost:7000/shared/utils.js",
"@shared/api": "http://localhost:7000/shared/api.js",
"@shared/composables": "http://localhost:7000/shared/composables.js",
"@shared/types": "http://localhost:7000/shared/types.js"
}
}
</script>
<!-- 预加载关键模块 -->
<link rel="modulepreload" href="http://localhost:7000/shared/components.js">
<link rel="modulepreload" href="http://localhost:7000/shared/utils.js">
</head>
<body>
<div id="app"></div>

View File

@@ -3,8 +3,8 @@ import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入 shared 的全局样式Module Federation 远程模块样式)
import 'shared/styles'
// 注意:shared 的样式现在通过 index.html 中的 <link> 标签加载
// 不再需要在这里导入:import 'shared/styles'
import App from './App.vue'
import router from './router/'

View File

@@ -5,7 +5,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title>泰豪电源 AI 数智化平台</title>
<!-- 引入 shared 模块的样式Module Federation 远程模块样式) -->
<link rel="stylesheet" href="/shared/assets/shared-styles.css">
<!-- 加载运行时配置(必须在其他脚本之前加载) -->
<script src="/app-config.js"></script>
<!-- <script src="/app-config.local.js"></script> -->

View File

@@ -250,6 +250,6 @@ watch(
)
</script>
<style lang="scss" scoped>
<style lang="scss">
@import "./AdminSidebarLayout.scss";
</style>

View File

@@ -268,6 +268,6 @@ watch(
)
</script>
<style lang="scss" scoped>
<style lang="scss">
@import "./SidebarLayout.scss";
</style>

View File

@@ -5,8 +5,8 @@ import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入 shared 的全局样式Module Federation 远程模块样式)
import 'shared/styles'
// 注意:shared 的样式现在通过 index.html 中的 <link> 标签加载
// 不再需要在这里导入:import 'shared/styles'
import App from './App.vue'
import router from './router/'

View File

@@ -94,7 +94,7 @@ const componentGroups = computed(() => {
})
</script>
<style scoped>
<style lang="scss">
.app-layout {
height: 100vh;
display: flex;

View File

@@ -110,10 +110,11 @@ export default defineConfig({
rollupOptions: {
output: {
format: 'es',
// 确保 CSS 文件名可预测
// 确保 CSS 文件名固定,不带 hash
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') {
return 'assets/style.css'
// CSS 文件使用固定名称,便于在 index.html 中引用
if (assetInfo.name?.endsWith('.css')) {
return 'assets/shared-styles.css'
}
return 'assets/[name]-[hash][extname]'
}

View File

@@ -5,7 +5,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="/favicon.ico">
<title>案例管理系统</title>
<!-- 引入 shared 模块的样式Module Federation 远程模块样式) -->
<link rel="stylesheet" href="/shared/assets/shared-styles.css">
<!-- 加载运行时配置(必须在其他脚本之前加载) -->
<script src="/app-config.js"></script>
<!-- <script src="/app-config.local.js"></script> -->

View File

@@ -5,8 +5,8 @@ import 'element-plus/dist/index.css'
import './assets/css/common.scss'
// 导入 shared 的全局样式Module Federation 远程模块样式)
import 'shared/styles'
// 注意:shared 的样式现在通过 index.html 中的 <link> 标签加载
// 不再需要在这里导入:import 'shared/styles'
import App from './App.vue'
import router from './router/'