How to use the @form-create/core function in @form-create/core

To help you get started, we’ve selected a few @form-create/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xaboy / form-create / packages / iview / src / core / index.js View on Github external
import {isPlainObject, toString} from '@form-create/utils';

VNode.use(nodes);

export const drive = {
    ui: process.env.UI,
    version: process.env.VERSION,
    formRender,
    components,
    parsers,
    makers,
    getGlobalApi,
    getConfig,
};

const {FormCreate, install} = createFormCreate(drive);

Creator.prototype.event = function (key, value) {
    let event;

    if (!isPlainObject(key)) {
        event = {[key]: value}
    } else {
        event = key;
    }

    Object.keys(event).forEach((eventName) => {
        const name = toString(eventName).indexOf('on-') === 0 ? eventName : `on-${eventName}`;
        this.on(name, event[eventName]);
    });
    return this;
};

@form-create/core

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

MIT
Latest version published 15 days ago

Package Health Score

79 / 100
Full package analysis