我使用V-選擇在$ HTTP負載後追加值V-選擇2不能通過
/search/tag?keyword=
我
return $tags->toJson(); (laravel)
有數據返回但不能附加到v選項中的選項
查看模板
<template>
<v-select multiple
:debounce="250"
:on-search="getOptions"
:options="options"
placeholder="Search Tag...">
<template slot="option" scope="option" value="option.id">
{{option.name}}
</template>
</v-select>
</template>
Vue腳本
import vSelect from "vue-select"
export default {
components: {vSelect},
data() {
return {
options: null
}
},
methods: {
getOptions(search, loading) {
loading(true)
this.$http.post(base_url+'/search/tag', {
keyword: search
}).then(resp => {
// this.options = JSON.stringify(resp.data);
console.log(resp.data);
loading(false)
})
}
}
}
它看起來不像文檔中的選項插槽。 – Bert
是的,我已經刪除它 –