robertarissen's avatar

Property or method "test" is not defined

Hello Laracast,

Im using Vue.js and Laravel for a long time. I want to use Vuejs without laravel. So I had copied the elixer file from laracast and now work gulp fine.

Only my compontent tag don't work. Mounted() give no result en data() is also not working.

My Component:

<template>
    <div class="container-fluid">
        
        <div class="row">
        
            <div class="col-md-8">
                <h2>Agenda {{ test }}</h2>
            </div>
            
            <div class="col-md-4 text-right">
                <h3>
                    <i class="fa fa-arrow-left" aria-hidden="true"></i>
                    Week 3   
                    <i class="fa fa-arrow-right" aria-hidden="true"></i>
                            
                </h3>
            </div>
        
        </div>
        
        
        <div class="flex">
            <div class="agenda-item">
                <div class="item-titel">MA 6 JUNI 2017</div>
                <p>Geen items gevonden</p>          
            </div>      
        </div>
    </div>
</template>

<script>
    export default {
        data() {
          return {
            test: 'jow',
          }
        },

        mounted() {

        },

        methods: {
        },
    }
</script>




app.js:
/**
 * First we will load all of this project's JavaScript dependencies which
 * include Vue and Vue Resource. This gives a great starting point for
 * building robust, powerful web applications using Vue and Laravel.
 */

require('./bootstrap');


/**
 * 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.
 */

Vue.component('navbar', require('./components/navBar.vue'));
Vue.component('agenda', require('./components/agenda.vue'));

window.event = new Vue()

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

The template render is fine but the script tag don't render?

Mounted(){ alert('Test'); }

give no result.

Error: vue.js?3de6:440 [Vue warn]: Property or method "test" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

found in

--->

0 likes
0 replies

Please or to participate in this conversation.