UNPKG

@form-create/core

Version:

FormCreate低代码表单渲染引擎,可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单。支持6个UI框架,适配移动端,并且支持生成任何 Vue 组件。

30 lines (26 loc) 763 B
import extend from '@form-create/utils/lib/extend'; export default function useRender(Handler) { extend(Handler.prototype, { clearNextTick() { this.nextTick && clearTimeout(this.nextTick); this.nextTick = null; }, bindNextTick(fn) { this.clearNextTick(); this.nextTick = setTimeout(() => { fn() this.nextTick = null; }, 10); }, render() { // console.warn('%c render', 'color:green'); ++this.loadedId; if (this.vm.unique > 0) return this.$render.render(); else { this.vm.unique = 1; return []; } }, }); }