Объявление Object.prototype в JS - VuerouterJavascript

Форум по Javascript
Anonymous
Объявление Object.prototype в JS - Vuerouter

Сообщение Anonymous »

Я объявил метод расширения для объектов, создав свою собственную функцию. Тем не менее, я нигде не звоню и не импортирую. В результате я получаю исключение. Как я могу это исправить? Я не помню такого поведения в Vue 2. < /p>
Object.prototype.mergeObjXXXX = function(obj2){
console.log(this);
console.log(obj2);
}
< /Code> Просмотр 3.5.13
vue-router: 4.5.0 < /p>
main.js:38 TypeError: Cannot convert undefined or null to object
at Object.assign ()
at Object.mergeObjXXXX (ext.js:20:9)
at extractComponentsGuards (vue-router.js?v=ea680b7e:1465:32)
at vue-router.js?v=ea680b7e:2484:16


Подробнее здесь: https://stackoverflow.com/questions/794 ... s-a-method

Вернуться в «Javascript»