UNPKG

@alilc/lowcode-rax-renderer

Version:

Rax renderer for Ali lowCode engine

34 lines 1.52 kB
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } import { blockRendererFactory } from '@alilc/lowcode-renderer-core'; var raxBlockRendererFactory = function () { var OriginBlock = blockRendererFactory(); return /*#__PURE__*/function (_OriginBlock) { _inheritsLoose(BlockRenderer, _OriginBlock); function BlockRenderer() { return _OriginBlock.apply(this, arguments) || this; } var _proto = BlockRenderer.prototype; _proto.render = function render() { // @ts-ignore var that = this; var _that$props = that.props, __schema = _that$props.__schema, __components = _that$props.__components; if (that.__checkSchema(__schema)) { return '区块 schema 结构异常!'; } that.__debug("render - " + __schema.fileName); return that.__renderContextConsumer(function children(context) { that.context = context; that.__generateCtx({}); that.__render(); return that.__renderComp(__components == null ? void 0 : __components.Block, { blockContext: that }); }); }; return BlockRenderer; }(OriginBlock); }; export default raxBlockRendererFactory;