我是 Vue.js 的新手。我想基于 Vue.js 組件創建具有多個標簽(用戶技能)的輸入。我設法讓它工作,但我找不到如何在表單中發布我的標簽。這是我的代碼:TagField.view<template> <div> <vue-tags-input :tags="tags" :autocomplete-items="filteredItems" :add-only-from-autocomplete="true" @tags-changed="newTags => tags = newTags" /> <input type="hidden" name="tags" :value="tags"> </div></template><script>import VueTagsInput from '@johmun/vue-tags-input';export default { components: { VueTagsInput, }, props:[ 'options', 'selection', ], data() { return { tag: '', tags: this.selection, autocompleteItems: this.options, }; }, computed: { filteredItems() { return this.autocompleteItems.filter(i => { return i.text.toLowerCase().indexOf(this.tag.toLowerCase()) !== -1; }); }, },};</script>編輯.blade.php<div class="form-group"> <tag-field :selection='@json($expert->skills()->get(['skills.name AS text', 'skills.id', 'skills.slug'])->makeHidden('pivot'))' :options='@json(\App\Models\Skill::get(['name AS text', 'id', 'slug']))' ></tag-field></div>如您所見,我嘗試添加一個包含我的標簽的隱藏字段,但值如下所示:<input type="hidden" name="tags" value="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]">
如何使用 JohMun/vue-tags-input 發布標簽值
犯罪嫌疑人X
2023-04-27 16:30:26