解决方案:Class extends value #
2019-09-27  本文已影响0人  灬小白
var Father = {
    // ...
}
class Child extends Father {
     // ...
}
// Uncaught TypeError: Class extends value #<Object> is not a constructor or null
 
// 解决方案
Object.setPrototypeOf(Child.prototype, Father);

如果Father是引用进来的,看下在导出的时候是不是写的是module.export,正确的写法为:
module.exports = Father

上一篇 下一篇

猜你喜欢

热点阅读