【无标题】

发布时间:2023年12月26日

1.原生html页面中使用echart控制台警告,如下


2.方案一:本地引入js代码

!function (e) { "function" == typeof define && define.amd ? define(e) : e() }(function () { var e, t = ["scroll", "wheel", "touchstart", "touchmove", "touchenter", "touchend", "touchleave", "mouseout", "mouseleave", "mouseup", "mousedown", "mousemove", "mouseenter", "mousewheel", "mouseover"]; if (function () { var e = !1; try { var t = Object.defineProperty({}, "passive", { get: function () { e = !0 } }); window.addEventListener("test", null, t), window.removeEventListener("test", null, t) } catch (e) { } return e }()) { var n = EventTarget.prototype.addEventListener; e = n, EventTarget.prototype.addEventListener = function (n, o, r) { var i, s = "object" == typeof r && null !== r, u = s ? r.capture : r; (r = s ? function (e) { var t = Object.getOwnPropertyDescriptor(e, "passive"); return t && !0 !== t.writable && void 0 === t.set ? Object.assign({}, e) : e }(r) : {}).passive = void 0 !== (i = r.passive) ? i : -1 !== t.indexOf(n) && !0, r.capture = void 0 !== u && u, e.call(this, n, o, r) }, EventTarget.prototype.addEventListener._original = e } });
//# sourceMappingURL=index.umd.js.map  

方案二:cdn引入

<script type="text/javascript" src="https://unpkg.com/default-passive-events"></script>

文章来源:https://blog.csdn.net/m0_72929120/article/details/135227683
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。