部分低端机型会报错:globalThis is not define
用了vue3-seamless-scroll 之后,部分手机报了错误:globalThis is not define,如果没猜错的话,应该是兼容没做好
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) : typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Vue3SeamlessScroll = {}, global.Vue)); })
这个问题希望能解决一下。
PS:另外说一下我的解决办法,我是直接在html头部加了 js 做的兼容:
!(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)
感谢作者的付出,插件挺好用的。赞!