Компонент VueJS не рендерит, возвращает строку - PullRequest
1 голос
/ 12 апреля 2019

Моя проблема в том, что компонент vue, называемый "уведомлением", не отображается. Это на самом деле возвращает эту строку <!--function(e,n,r,i){return rn(t,e,n,r,i,!0)}-->

Ниже мой app.js

import swal from 'sweetalert';
import StarRating from 'vue-star-rating';

require('./bootstrap');
window.Vue = require('vue');

Vue.component('notification', require('./components/Notification.vue'));
Vue.component('books', require('./components/Books.vue'));
Vue.component('book-row', require('./components/BookRow.vue'));
Vue.component('star-rating', StarRating);


var app = new Vue({
  el: '#app',
  methods: {
    setRating: function(rating){
        $.ajaxSetup({
            headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
        });
        $.ajax({
            type: 'post',
            url: '/set-book-rating',
            dataType: 'json', 
            data: {
                'book_id': window.BookID,
                'rating': rating,
            },
            success: function(data) {
            },
            error: function(response){

            },
        });
    }
  },
  computed :{
      rating : function(){
        if (typeof user_rating !== 'undefined') {
            return user_rating;
        } else {
            return null;
        }
      }
   },
});



И вот мой файл лезвия

<notification :user="{{auth()->user()}}" :notifications="{{auth()->user()->notifications->take(4)}}"></notification>

Я был бы очень признателен за любую помощь, пожалуйста.

...