function PrimaryStudent(props) {
Student.call(this. props);
}
这里就是单纯的用call把Student的this修正为PrimaryStudent的this然后传参调用,并没有用new Student()所以这里的Student就是一个普通函数,而不应该叫做 构造函数。
Sign in to make a reply
熠阳0121
function PrimaryStudent(props) {
Student.call(this. props);
}
这里就是单纯的用call把Student的this修正为PrimaryStudent的this然后传参调用,并没有用new Student()所以这里的Student就是一个普通函数,而不应该叫做 构造函数。