import {CtlBase} from './CtlBase' import {parseYvanPropChangeVJson} from './CtlUtils' import {YvEvent, YvEventDispatch} from './YvanEvent' import {CtlDividerDefault} from './CtlDefaultValue' /** * 分割线组件 * @author yvan */ export class CtlDivider extends CtlBase { static create(module: any, vjson: any): CtlDivider { const that = new CtlDivider(vjson) that._module = module _.defaultsDeep(vjson, CtlDividerDefault) const yvanProp = parseYvanPropChangeVJson(vjson, []) // 将 vjson 存至 _webixConfig that._webixConfig = vjson // 将 yvanProp 合并至当前 Ctl 对象 _.assign(that, yvanProp) // 将 _webixConfig 合并至 vjson, 最终合交给 webix 做渲染 _.merge(vjson, that._webixConfig, { view: 'template', height:45, template: that.getDividerHtml(vjson) }) return that } /*============================ 公共属性部分 ============================*/ public getDividerHtml(vjson:any): string { const list=`
`+vjson.text+`
` return list } }