Example.vue?dd4e:5[vue-loader] resources/assets/js/components/Example.vue: named exports in *.vue files are ignored.(anonymous function) @ Example.vue?dd4e:5(anonymous function) @ app.js:301__webpack_require__ @ app.js:20(anonymous function) @ app.js?8b67:17(anonymous function) @ app.js:588__webpack_require__ @ app.js:20(anonymous function) @ app.js:64(anonymous function) @ app.js:67
QuestionFollowButton.vue?4972:5[vue-loader] resources/assets/js/components/QuestionFollowButton.vue: named exports in *.vue files are ignored.(anonymous function) @ QuestionFollowButton.vue?4972:5(anonymous function) @ app.js:307__webpack_require__ @ app.js:20(anonymous function) @ app.js?8b67:18(anonymous function) @ app.js:588__webpack_require__ @ app.js:20(anonymous function) @ app.js:64(anonymous function) @ app.js:67
vue.common.js?e881:10233 Download the Vue Devtools for a better development experience:
https://github.com/vuejs/vue-devtools
我在console.log(response.data); 的时候 没有出现任何内容, 出现两个warning, 好像API也没有调用似的, show页面里 显示的正常,gulp 也正常 不知道什么问题
<script>
export default {
props:['question','user'],
mounted() {
this.$http.post('/api/question/follower',{'question':this.question,'user':this.user}).then( response => {
console.log(response.data);
});
},
data() {
return {
followed :false,
}
},
computed: {
text() {
return this.followed ? '已关注' : '关注该问题';
}
}
}
</script>
Route::post('/question/follower', function (Request $request) {
return response()->json(['question'=> request('question')]);
})->middleware('api');
<question-follow-button question="{ $question->id }"
user="{ Auth::id() }"></question-follow-button>