I am new to Vue js i am practicing for loop in vue js When i try to fetch data from my app js file into my welcome blade file it displays the exact same variable that i wrote in code instead of showing value stored in the object.
Here is my code of app.js file
require('./bootstrap');
window.Vue = require('vue');
Vue.component('example', require('./components/Example.vue'));
const app = new Vue({
el: '#app'
data: {
message: '',
tasks: [
{ name: 'Foo' },
{ name: 'Bar' }
]
}
});
and this is my welcome blade file code
links
<link href="/css/app.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="/js/app.js"> </script>
and the list i want to repeat
<div class="title m-b-md" id="app">
<ul>
<li v-for="task in tasks" >
@{{ task.name }}
</li>
</ul>
<example></example>
</div>