Почему не отображаются компоненты Vue (Vue + Laravel)?

Всем привет, после переноса кода на сервер не отображаются компоненты Vue. Локально все ок.
Так же если написать Vue -V то ругается что такой команды нет.
Composer install и npm i отработал без ошибок, так же для верности отдельно ставил vue командой npm i vue, все установилось без проблем, но после npm run prod все так же пусто.
Ниже на всякий случка код

App.js
/**
 * First we will load all of this project's JavaScript dependencies which
 * includes Vue and other libraries. It is a great starting point when
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');

window.Vue = require('vue');

/**
 * Next, we will create a fresh Vue application instance and attach it to
 * the page. Then, you may begin adding components to this application
 * or customize the JavaScript scaffolding to fit your unique needs.
 */
import TextHighlight from 'vue-text-highlight'

Vue.component('search-component', require('./components/Search.vue'));
Vue.component('financial-component', require('./components/financialUl/Financial.vue'));
Vue.component('sidebar-component', require('./components/financialUl/Sidebar.vue'));
Vue.component('search-modal-component', require('./components/SearchModal.vue'));
Vue.component('search-modal-region-component', require('./components/SearchModalRegion.vue'));
Vue.component('text-highlight', TextHighlight);

const app = new Vue({
    el: '#app'
});


index.blade.php

<!DOCTYPE html>
<html lang="ru">
<head>
    @include('blocks.head')
    <script src="{{ asset ('js/app.js')}}" defer></script>
    @stack('styles')
    <title>@yield('title')</title>
</head>
<body>
<div id="app" style="padding-bottom: 0">

    @include('blocks.left-mnu')
    @yield('content')

</div>


Сам файл с компонентом
@extends('layouts.index')


@section('content')
    <!-- Место для вставки контента страницы -->
   
    <section class="search-index">
        <div class="wrap no-hidden">
            <search-component route={{route('get.search')}} url={{ route('le.render')}} :button="true"></search-component>
        </div>
    </section>
       <!-- Место для вставки контента страницы -->
@endsection
  • Вопрос задан
  • 804 просмотра
Решения вопроса 1
@vos_50 Автор вопроса
Разобрался, в файле app.js нужно было добавить .default
Тык
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы