0
我正在運行一個Laravel 5.3應用程序,該應用程序支持帶有webpack的VueJS。我在使用VUE,多選做的一個問題,它顯示:Laravel 5.3&vuejs片段實例問題
[Vue warn]: Attribute "v-model" is ignored on component <multi-select> because the component is a fragment instance:
我使用VUE,多選文件,我最終將使用以顯示一個國家在提供一個基本的例子形式,因此組件的名稱。我試過尋找解決方案,但沒有人用Laravel 5.3似乎有這個問題。我試過Laravel附帶的示例組件,它工作正常。
app.js:
Vue.component('country', require('./components/country-select.vue'));;
new Vue({
el: 'body'
});
國家select.vue:
<template>
<div class="dropdown">
<multi-select v-model="value" :options="options" :searchable="false" :close-on-select="false" :show-labels="false" placeholder="Pick a value"></multi-select>
</div>
</template>
<script>
import Multiselect from 'vue-multiselect';
export default {
components: {
'multi-select': Multiselect
},
data() {
return {
value: '',
options: ['Select option', 'options', 'selected', 'mulitple', 'label', 'searchable', 'clearOnSelect', 'hideSelected', 'maxHeight', 'allowEmpty', 'showLabels', 'onChange', 'touched']
}
}
}
</script>
刃文件:
<country :options="options"
:selected.sync="selected"
:show-label="false">
</country>
解決了這個問題嘗試將'div.dropdown'包裝成一個父div,所以結構應該是'template> div> div.dropdown>多選' –
沒有區別。 –