s.funDeleteFile = function(fileDelete) {
var arrFile = [];
this.fileFilter = arrFile;
return this;
};
s.funGetFiles = function(e) {
console.log(this.fileFilter)//取不到值
return this;
};
funDeleteFile: function(fileDelete) {
var arrFile = [];
this.fileFilter = arrFile;
return this;
},
funGetFiles: function(e) {
console.log(this.fileFilter)//可以取到
return this;
},
这是为啥?对象与方法的不同吗?TAT
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这个地方你就要去了解下this的指向问题了,建议阅读此篇 http://www.cnblogs.com/pssp/p...
this分别指向window和对象,基础知识没学好。。
你在两个地方打印一下this就行了