解决浏览器端 globalThis is not defined 报错

解决浏览器端 globalThis is not defined 报错

前言

在使用低版本火狐浏览器出现报错globalThis is not defined

解决办法:

在vue的index.html 中添加 this.globalThis || (this.globalThis = this)

java 复制代码
<head>
    <script>
        this.globalThis || (this.globalThis = this)
    </script>
    ...
</head>
相关推荐
文阿花16 小时前
大屏地图实现方案之-高德(二)
vue·地图·高德
森林的尽头是阳光20 小时前
前端使用postman快速造数据
前端·javascript·vue·postman·造数·本地测试
初心丨哈士奇2 天前
一行 # 的差别:彻底搞懂前端路由的 hash 和 history 模式
前端·浏览器
文阿花2 天前
大屏实现方案之-高德
vue·地图·高德
Anesthesia丶3 天前
Vite + Svelte + shadcn-svelte 最小化 Demo+Vue3语法对比总结
vue·vite·svelte·shadcn-svelte
孟郎郎3 天前
TimeoutError: The operation was aborted due to timeout at new DOMException
ai·前端框架·npm·vue·pnpm·deepseek
lpd_lt3 天前
AI生成Spring Boot + Vue 3 + MySQL + MyBatis-Plus的项目实战
java·spring boot·vue·ai编程
来杯@Java3 天前
图书管理系统(基于springboot+vue前后端分离的项目)计算机毕业设计java
java·spring boot·spring·vue·毕业设计·mybatis·课程设计
一念&4 天前
油猴脚本教程——元数据块
javascript·浏览器·脚本·油猴
华大哥4 天前
前后端分离实现五级行政区划树形菜单及设备查询管理
sqlite·vue·springboot