mercredi 24 mai 2017

Vue js fails to render the component in Laravel 5.4

Am new to laravel and VUe js, after a fresh installation of laravel 5.4 it comes with an example vue component that am trying to render in a blade file but it fails

IN the folder resources/assets/js/components/Example.vue i have

<template>
  <div class="container">
      Testing component
   </div>
</template>

 <script>
   export default {

    mounted() {
        console.log('Component mounted.')
    }
   }
 </script>

Then i the folder resources/assets/js/app.js i have

  Vue.component('example', require('./components/Example.vue'));

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

Then in the welcome.blade.php i have

<div id="app"
   <example></example>
 </div>  

THe above component is not rendered, i have also run

npm run watch

Where am i going wrong?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qfyi4q
via IFTTT

Aucun commentaire:

Enregistrer un commentaire