Import vue package in laravel

前端 未结 2 1644
闹比i
闹比i 2021-01-22 01:07

What is the corect way to import vue packages in laravel 5.6? It comes with vue and bootstrap preinstall. I see they are all compile in app.js from public directory but I can fi

相关标签:
2条回答
  • 2021-01-22 01:58

    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
    },
    
    0 讨论(0)
  • 2021-01-22 02:01

    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
            };
        },
    ...
    
    0 讨论(0)
提交回复
热议问题