add keyword during url import

This commit is contained in:
smilerz
2021-02-09 12:55:40 -06:00
parent 4a4dafd69c
commit e0a0eeeecc

View File

@@ -190,6 +190,9 @@
:hide-selected="true" :hide-selected="true"
:preserve-search="true" :preserve-search="true"
placeholder="{% trans 'Select one' %}" placeholder="{% trans 'Select one' %}"
tag-placeholder="{% trans 'Add Keyword' %}"
:taggable="true"
@tag="addKeyword"
label="text" label="text"
track-by="id" track-by="id"
id="id_keywords" id="id_keywords"
@@ -357,6 +360,10 @@
this.units.push(new_unit.unit) this.units.push(new_unit.unit)
this.recipe_data.recipeIngredient[index] = new_unit this.recipe_data.recipeIngredient[index] = new_unit
}, },
addKeyword: function (tag) {
let new_keyword = {'text':tag,'id':null}
this.recipe_data.keywords.push(new_keyword)
},
openUnitSelect: function (id) { openUnitSelect: function (id) {
let index = id.replace('unit_', '') let index = id.replace('unit_', '')
if (this.recipe_data.recipeIngredient[index].unit !== null) { if (this.recipe_data.recipeIngredient[index].unit !== null) {