[Vuejs]-Hide popup box when clicked anywhere on the document

0👍

If you want to be able to edit multiple items at the same time, you should store the list of edited items, not global edit_item_visible flag.

    showEdit(item)
    {
        this.selected = item;
        this.editing_items.push(item);
    }


    // v-on-clickaway="cancelEdit(item)"
    cancelEdit(item)
    {
        let idx = this.editing_items.indexOf(item);
        this.editing_items.splice(idx, 1);
    }

Leave a comment