(function(win,doc,$){
// 声明构造函数
var AddInfo = function(opt){
// 初始化参数
this.options = {
triggerEl : '', // 触发弹框的元素
modalEl : '', // 弹框对象
tableList : '' // table内容展示对象对象
}
// 引入传入的参数
this.opt = $.extend('', this.options, opt || {});
// 调用初始化方法
this.init().getVal();
}
$.extend( AddInfo.prototype,{
init : function(){
var self = this;
// 获取触发弹框的元素
self.triggerEl = self.opt.triggerEl;
// 获取弹框对象
self.modalEl = self.opt.modalEl;
// 获取对应table对象
self.tableList = self.opt.tableList;
// 链式调用
return this;
},
getVal:function(){
var self = this;
console.log($(self.tableList).val())
// 链式调用
return this;
}
})
win.AddInfo = AddInfo;
})(window,document,jQuery)