0

I'm running a Laravel 5.3 application which supports VueJS out of the box with webpack. I'm having an issue making using vue-multiselect, which displays:

[Vue warn]: Attribute "v-model" is ignored on component <multi-select> because the component is a fragment instance:

I'm using a basic example available in the vue-multiselect documentation, which I will eventually be using to display countries in a form, hence the name of the component. I've tried looking for solutions but nobody with Laravel 5.3 seems to be having this problem. I've tried the example component that ships with Laravel and it works fine.

app.js:

Vue.component('country', require('./components/country-select.vue'));;

new Vue({
    el: 'body'
});

country-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>

Blade file:

<country :options="options"
    :selected.sync="selected"
    :show-label="false">
    </country>
2
  • Try to wrap div.dropdown into one parent div, so structure should be template>div>div.dropdown>multi-select Commented Jan 22, 2017 at 10:32
  • Makes no difference. Commented Jan 22, 2017 at 12:12

1 Answer 1

-1

Solved this issue by upgrading to Vue 2.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.