待解决问题
/**base.js*/
class Base {
constructor() {
}
res_err(res, err) {
}
}
module.exports = Base;
/**test.js*/
class Spring_plow extends Base {
constructor() {
super();
}
a() {
this.res_err()
}
}
module.exports = Spring_plow;
let spring_plow = new Spring_plow();
router.post('/test', spring_plow.a);
结果:报this is undefined

浙公网安备 33010602011771号