How to use the @form-create/utils.extend function in @form-create/utils

To help you get started, we’ve selected a few @form-create/utils 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 / element-ui / src / components / upload / render.js View on Github external
init() {
        let handler = this.handler;
        this.uploadOptions = extend({...this.options.upload}, this.handler.rule.props);
        this.issetIcon = this.uploadOptions.allowRemove || this.uploadOptions.handleIcon;
        this.propsData = this.vData.props(this.uploadOptions).class('fc-upload-con', true)
            .props('onSuccess', (...args) => this.onSuccess(...args))
            // .props('onRemove', (...args) => this.onRemove(...args))
            .ref(handler.refName).key(`fip${handler.unique}`).get();
    }
github xaboy / form-create / packages / core / src2 / factory / render.js View on Github external
parse(form) {
        let {type, rule, refName, key, noValue} = this.handler;
        if (type === 'template' && rule.template) {

            if (Vue.compile === undefined) {
                console.error('使用的 Vue 版本不支持 compile' + errMsg());
                return [];
            }

            if (isUndef(rule.vm)) rule.vm = new Vue;

            let vn = Vue.compile(rule.template, {}).render.call(rule.vm);
            if (vn.data === undefined) vn.data = {};
            extend(vn.data, rule);
            vn.key = key;
            return [vn];

        } else if (!noValue) {
            return form.makeComponent(this.handler.render);
        } else {
            rule.ref = refName;
            if (isUndef(rule.key))
                rule.key = 'def' + uniqueId();
            let vn = this.vNode.make(type, {...rule}, this.childrenParse(form));

            vn.key = key;
            return [vn];
        }

    }
github xaboy / form-create / packages / iview / src / components / upload / render.js View on Github external
init() {
        let handler = this.handler;
        this.uploadOptions = extend({...this.options.upload}, this.handler.rule.props);
        this.issetIcon = this.uploadOptions.allowRemove || this.uploadOptions.handleIcon;
        this.propsData = this.vData.props(this.uploadOptions)
            .props('onSuccess', (...args) => this.onSuccess(...args))
            .props('onRemove', (...args) => this.onRemove(...args))
            .props('beforeUpload', (...args) => this.beforeUpload(...args))
            .ref(handler.refName).key(`fip${handler.unique}`).get();
    }
github xaboy / form-create / packages / core / src / factory / creator.js View on Github external
constructor(type, title, field, value, props = {}) {
        super();
        extend(this._data, baseRule());
        extend(this._data, {type, title, field, value});
        if (isPlainObject(props)) this.props(props);
    }
github xaboy / form-create / packages / core / src / factory / vData.js View on Github external
VData.prototype[key] = function (obj, val) {
        if (isUndef(obj)) return this;

        if (isPlainObject(obj)) {
            $set(this._data, key, extend(this._data[key], obj));
        } else {
            $set(this._data[key], toString(obj), val);
        }

        return this;
    };
});
github xaboy / form-create / packages / core / src2 / factory / handler.js View on Github external
function parseOn(on, emitEvent) {
    if (Object.keys(emitEvent).length > 0) extend(on, emitEvent);
    return on;
}
github xaboy / form-create / packages / core / src / factory / maker.js View on Github external
export default function makerFactory() {
    let maker = {};


    const commonMaker = creatorFactory('');

    extend(maker, {
        create(type, field, title) {
            let make = commonMaker('', field);
            make._data.type = type;
            make._data.title = title;
            return make;
        },
        createTmp(template, vm, field, title) {
            let make = commonMaker('', field);
            make._data.type = 'template';
            make._data.template = template;
            make._data.title = title;
            make._data.vm = vm;
            return make;
        }
    });
    maker.template = maker.createTmp;