Skip to content

Duplicating an data object #971

@FSElias

Description

@FSElias

Hello,
in order to duplicate an object with all its children, I had to use a jQuery function, please is there a better way in Vue? I am using Vue 0.12.1

duplicateThis: function (field) {
    var currentField = this.fields[field.index];

    var insertField = {
        name: currentField.name,
        type: currentField.type,
        description: currentField.description,
        options: $.extend(true, {}, currentField.options),
        required: currentField.required
    };

    this.fields.splice(field.index + 1, 0, insertField);
}

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions