1 month ago

Vue script not working

Posted 1 month ago by artisticre

I have this code when on my individual page, does not work. But if I put it in app.js, it works but there is an error because it cant find $user. How do I get it to work on my blade view?


    var app = new Vue({
      el: '#app',
      data: {
        rolesSelected: {!! $user->roles->pluck('id') !!}


my layout where I yield scripts

<div class="management-area" id="app">
                  <script src="{{ asset('js/app.js') }}" defer></script>

Please sign in or create an account to participate in this conversation.