UNPKG

@dooboostore/dom-render

Version:
40 lines 1.37 kB
import { ComponentBase } from '../ComponentBase'; import { DomRender } from '../../DomRender'; import { RawSet } from '../../rawsets/RawSet'; export var If; (function (If_1) { If_1.selector = 'dr-if'; class If extends ComponentBase { constructor() { super(...arguments); this.sw = false; } onInitRender(param, rawSet) { super.onInitRender(param, rawSet); } onChangeAttrRender(name, value, other) { super.onChangeAttrRender(name, value, other); if (this.equalsAttributeName(name, 'value')) { // console.log('------',this,name, value) this.sw = value; } } } If_1.If = If; })(If || (If = {})); // const iif = DomRender.createComponent({ // type: If.If, // tagName: If.selector, // template: '<div dr-if="@this@.sw" dr-option-strip="true">#innerHTML#</div>' }); export default { if: (config) => { return RawSet.createComponentTargetElement({ name: If.selector, template: '<div dr-if="@this@.sw" dr-option-strip="true">#innerHTML#</div>', objFactory: (e, o, r2, counstructorParam) => { return DomRender.run({ rootObject: new If.If(...counstructorParam), config: config }); } }); }, }; //# sourceMappingURL=If.js.map