vuejs / laravel-elixir-vue-2

Laravel Elixir Vue 2.0 support plugin
105 stars 20 forks source link

Life cycle hook problem #1

Closed AngryElephant closed 8 years ago

AngryElephant commented 8 years ago

I'm trying to play around with vue 2 and laravel 5.3 but there is something wrong:

gulp file:

const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2')

elixir(mix => {
    mix.sass('main.scss', 'public/assets/css/main.css')
    .webpack('components.js','public/assets/js/components.js');
});

Compenents.js

import Vue from 'vue'
import Chart from './components/Chart.vue';
var tg = new Vue({
    el: '#todayCharts',
    components: {Chart},
    mounted: function(){console.log('test')}
});

Chart.vue (cleaned)

<script>

export default {

    data: function(){

        return {

            series: []

        };
    },

    mounted: function() {
                alert('test chart');
                console.log('test chart');
                  },
}

</script>

The template is working but nothing happen on mounted in the component and i have no errors.

Any help ?

Thank you.

AngryElephant commented 8 years ago

Deleted node_module folder then npm install again and it work. I will never know ...