index.html 1.5 KB

123456789101112131415161718192021222324252627282930
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  6. <title>浠艾福</title>
  7. <!--preload-links-->
  8. <!--app-context-->
  9. <!-- H5 修复:uni-app 编译器在 tabBar 页面模块注入 exports.default.components=... 时
  10. 使用了自由变量 'exports'(webpack 压缩后模块参数是 a/e/t,e 才是 exports),
  11. 浏览器没有全局 exports,导致 ReferenceError 中断组件 chunk 执行、首页白屏。
  12. 提前 polyfill,让注入代码挂到 window.exports 不抛错;组件注册已由 main.js 的
  13. Vue.component('custom-tab-bar', CustomTabBar) 全局完成,不影响功能。 -->
  14. <script>
  15. if (typeof window !== 'undefined') {
  16. // uni-app 编译器在 tabBar 页面模块注入 exports.default.components=... 时
  17. // 混用自由变量 'exports'(webpack 压缩后模块参数为 a/e/t,e 才是 exports),
  18. // 浏览器无全局 exports → ReferenceError 中断组件 chunk 执行。
  19. // polyfill 需提供 window.exports 且带 .default 对象,避免再触发
  20. // "Cannot read properties of undefined (reading 'components')"。
  21. window.exports = window.exports || {};
  22. window.exports.default = window.exports.default || {};
  23. }
  24. </script>
  25. <link rel="stylesheet" href="/static/index.css" />
  26. </head>
  27. <body>
  28. <div id="app"><!--app-html--></div>
  29. </body>
  30. </html>