我通过创建自己的函数为对象声明了一个扩展方法。但是,我没有在任何地方调用或导入它。结果,我得到了一个异常。我该如何解决这个问题?我不记得 VUE 2 中存在这样的行为。
Object.prototype.mergeObjXXXX = function(obj2){
console.log(this);
console.log(obj2);
}
vue 3.5.13 vue-路由器:4.5.0
main.js:38 TypeError: Cannot convert undefined or null to object
at Object.assign (<anonymous>)
at Object.mergeObjXXXX (ext.js:20:9)
at extractComponentsGuards (vue-router.js?v=ea680b7e:1465:32)
at vue-router.js?v=ea680b7e:2484:16