Model文件
define(function() {
return Backbone.Model.extend({
url:function(){
console.log(this.id);//这个值可以输出
console.log(this.btnType);//这个值却不能
return "data/goods/" + this.id+ this.btnType+ "/skudata.php"
}
});
})


问题:为什么可以输出id,id外的参数无法获取
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
this.get("btnType") 问题解决
或者
获取url是在什么时候,model set的话应该在view里面绑定一个change事件再去获取url试试呢