import {ContainerComponent} from "../controller.js";

/**
 * 选项页组件
 * @param {[type]} dataModel [description]
 */
export default class TabPage extends ContainerComponent {

  constructor(__tfp, dataModel, parent) {
    super(__tfp, "TabPage", dataModel, parent);
  }

  get title() { return this.dataModel.title }
  set title(value) { 
    this.dataModel.title = value;
    if(this._jqObj) {
      for(var i=0; i<this.dataModel.components.length;i++) {
        let tabPageDM = this.dataModel.components[i];
        if(tabPageDM.id==this.id) {
          this.parent._jqObj.find("tfp-tab-head").eq(i).html(value);
          break;
        }
      }
    }
  }
}