Import vue package in laravel

最后都变了- 提交于 2019-12-02 01:31:53

I think that the simple will do

window.Vue = require('vue');
require('vue-search-select');

Then in your components you can import what you need on top:

import { BasicSelect } from 'vue-search-select';

export default {
    data() {
        return {
            keywords: null,
            options: [],
            item: null
        };
    },
...

One missing detail that tricked me with this one, you need to register the components like this, otherwise it won't be found:

components: {
  ModelSelect,
  BasicSelect
},
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!