|
|
@@ -1,5 +1,4 @@ |
|
|
|
var tagArray = []; |
|
|
|
const data=[]; |
|
|
|
const CreateMsgRouter = { |
|
|
|
template: ` |
|
|
|
<div class="content"> |
|
|
@@ -18,12 +17,12 @@ const CreateMsgRouter = { |
|
|
|
<b-taginput |
|
|
|
id="tag" |
|
|
|
v-model="selected" |
|
|
|
:data=taglist |
|
|
|
:data="filteredDataArray" |
|
|
|
autocomplete |
|
|
|
allow-new:false |
|
|
|
icon="label" |
|
|
|
placeholder="#" |
|
|
|
@typing="getFilteredTags" |
|
|
|
|
|
|
|
@input="saveTagsToArray"> |
|
|
|
</b-taginput> |
|
|
|
</b-field> |
|
|
@@ -52,12 +51,12 @@ const CreateMsgRouter = { |
|
|
|
<b-taginput |
|
|
|
id="tag" |
|
|
|
v-model="selected" |
|
|
|
:data=taglist |
|
|
|
:data="filteredDataArray" |
|
|
|
autocomplete |
|
|
|
allow-new:false |
|
|
|
icon="label" |
|
|
|
placeholder="#" |
|
|
|
@typing="getFilteredTags" |
|
|
|
|
|
|
|
@input="saveTagsToArray"> |
|
|
|
</b-taginput> |
|
|
|
</b-field> |
|
|
@@ -77,9 +76,20 @@ const CreateMsgRouter = { |
|
|
|
auth: auth, |
|
|
|
isDisabled: false, |
|
|
|
selected: [], |
|
|
|
searchtext : "", |
|
|
|
taglist: data, |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
filteredDataArray() { |
|
|
|
return this.taglist.filter((option) => { |
|
|
|
return option |
|
|
|
.toString() |
|
|
|
.toLowerCase() |
|
|
|
.indexOf(this.searchtext.toLowerCase()) >= 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
saveTagsToArray: function() { |
|
|
|
tagArray = this.selected; |
|
|
@@ -153,17 +163,9 @@ const CreateMsgRouter = { |
|
|
|
userField.prop('disabled',false); |
|
|
|
} |
|
|
|
|
|
|
|
this.list_tags(); |
|
|
|
//this.list_tags(); |
|
|
|
if ($(this).bootstrapMaterialDesign) |
|
|
|
$(this).bootstrapMaterialDesign(); |
|
|
|
}, |
|
|
|
}; |
|
|
|
|
|
|
|
function get_insert_tag(id){ |
|
|
|
$.ajax({ url: "api/tag/id/"+id, method: "GET" }).done(function (tag) { |
|
|
|
data.push("#" + tag.name); |
|
|
|
console.log("Array:"+this.data); |
|
|
|
}).fail(function (e, f, g) { |
|
|
|
console.log("cannot load " + id + ".json: " + e + f + g); |
|
|
|
}) |
|
|
|
} |