在前端引入一些开源组件库时,在低版本浏览器中可能会出现globalThis is not defined的问题,在html头部增加如下代码即可解决
<script>
!(function (t) {
function e() {
var e = this || self;
(e.globalThis = e), delete t.prototype._T_;
}
"object" != typeof globalThis &&
(this
? e()
: (t.defineProperty(t.prototype, "_T_", {
configurable: !0,
get: e,
}),
_T_));
})(Object);
</script>