function Student(name, age) {
this.name = name;
this.age = age;
this.sing = function () {
return this.name + this.age;
}
}
// 构造函数如下:
function Person (p) {
this.name = p.name;
}
// 如果用箭头函数作为构造函数,则如下
var Person = (p) = > {
this.name = p.name;
}
//例子
export const loadUserInfo = async (ouPath) => {
const res = await service.get('/user/loadAdd', {params: {ouPath } });
return res;
}
export const loadEditUser = async (guid, ouPath) => {
const res = await service.get('userInfo/loadEdit', {params: {guid, ouPath} });
return res;
}
ES6构造函数
最新推荐文章于 2023-07-09 21:06:41 发布