Import vue package in laravel

前端 未结 2 1670
闹比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 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
            };
        },
    ...
    

提交回复
热议问题