I am trying to replicate a tutorial on vuecasts (https://laracasts.com/series/learn-vue-2-step-by-step/episodes/18).
Everything looks fine and I don't get any errors except a warning:
Resource interpreted as Document but transferred with MIME type application/json: "http://vueme.app:8000/skills"
I already tried to change content-type to text/html as suggested here: Resource interpreted as Document but transferred with MIME type application/json warning in Chrome Developer Tools
web.php:
Route::get('/', function () {
return view('welcome');
});
Route::get('skills', function(){
return ['javascript', 'php', 'python'];
});
welcome.blade.php:
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<title>Laravel</title>
</head>
<body>
<div id="root">
<ul>
<li v-for="skill in skills" v-text="skill"></li>
</ul>
</div>
<script scr="https://unpkg.com/axios/dist/axios.min.js"></script>
<script scr="https://unpkg.com/vue"></script>
<script scr="/js/app.js"></script>
</body>
</html>
app.js:
new Vue({
el: '#root',
data:{
skills:[]
},
mounted(){
axios.get('/skills').then(response => this.skills = response.data);
}
});
What's not working?