UNPKG

@alilc/lowcode-rax-renderer

Version:

Rax renderer for Ali lowCode engine

38 lines (37 loc) 1.63 kB
"use strict"; exports.__esModule = true; exports.default = void 0; var _lowcodeRendererCore = require("@alilc/lowcode-renderer-core"); 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); } var raxBlockRendererFactory = function () { var OriginBlock = (0, _lowcodeRendererCore.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); }; var _default = exports.default = raxBlockRendererFactory;