刚开始弄js,云里雾里,上代码define(
"component_com",
["jquery"],
function(){
function createCom(parent){
this.parent = parent;
console.log("createCom"); // 这句正确显示了
}
function testFunc(){
console.log("testFunc");
}
return function component_com(parent){
createCom(parent);
};
}
)// 外部调用:
var obj = new component_com(par);
obj.testFunc(); // 这句错误,报不存在obj.testFunc();报testFunc不存在,求解
"component_com",
["jquery"],
function(){
function createCom(parent){
this.parent = parent;
console.log("createCom"); // 这句正确显示了
}
function testFunc(){
console.log("testFunc");
}
return function component_com(parent){
createCom(parent);
};
}
)// 外部调用:
var obj = new component_com(par);
obj.testFunc(); // 这句错误,报不存在obj.testFunc();报testFunc不存在,求解
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货