【发布时间】:2016-03-07 10:06:37
【问题描述】:
这个错误出现在 post 和 get 请求的日志中。我正在使用 laravel 5,并在页面底部按顺序拉入 vuejs 和 vue-resource。但由于某种原因,使用this.$http.get 或this.$http.post 发出任何请求都会返回标题中的错误。
脚本
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.10/vue.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue-resource/0.7.0/vue-resource.min.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="js/scrolling-nav.js"></script>
<script src="js/app.js"></script>
Js/app.js 代码
new Vue({
el: '#application',
data: {
},
ready: function(){
this.openModal();
},
methods: {
openModal: function(){
$('td').on('click', function(){
if($(this).hasClass('not-month'))
{
}
else
{
var year = '2016';
var month = $(this).parent().parent().parent().parent().find('h4').text();
var day = $(this).text();
console.log(day + ' ' + month + ' ' + year);
this.$http.get('/test', function(response){
this.$set('test', response);
});
}
});
}
}
});
【问题讨论】:
标签: javascript laravel vue.js