首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Laravel 5.3 & vuejs片段实例问题

Laravel 5.3 & vuejs片段实例问题
EN

Stack Overflow用户
提问于 2017-01-22 08:06:01
回答 1查看 243关注 0票数 0

我正在运行一个支持VueJS开箱即用的Laravel5.3应用程序,我和webpack在一起。我在使用vue-multiselect时遇到问题,它显示:

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

我使用的是vue-multiselect文档中提供的一个基本示例,我最终将使用它在表单中显示国家/地区,因此组件的名称也随之而来。我试过寻找解决方案,但似乎没有人在Laravel 5.3上遇到这个问题。我尝试了Laravel附带的example组件,它工作得很好。

app.js:

代码语言:javascript
复制
Vue.component('country', require('./components/country-select.vue'));;

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

国家/地区-select.vue:

代码语言:javascript
复制
<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>

刀片文件:

代码语言:javascript
复制
<country :options="options"
    :selected.sync="selected"
    :show-label="false">
    </country>
EN

回答 1

Stack Overflow用户

发布于 2017-01-23 06:45:45

通过升级到Vue 2解决了这个问题。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41785939

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档