Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (37 sloc) 989 Bytes
<div id="app">
<h1>Tasks - new</h1>
<hr />
<div class="form-group">
<label for="TopicTitle">タイトル</label>
<input type="text" class="form-control" id="title" v-model="title">
</div>
<div class="form-group">
<label for="TopicContent">content</label>
<textarea class="form-control" id="content" rows="3" v-model="content"></textarea>
</div>
<button v-on:click="send_post">投稿</button>
</div>
<!-- -->
<script>
new Vue({
el: '#app',
created () {
},
data: {
title:'',
content:''
},
methods: {
send_post(){
var task = {
'title': this.title,
'content': this.content
};
axios.post('/api/tasks_new' , task ).then(res => {
console.log(res.data );
window.location.href = '/tasks';
});
},
}
});
</script>
You can’t perform that action at this time.