Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (38 sloc) 1022 Bytes
<div id="app">
<h1>Todos - 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="10" 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,
'complete' : 0
};
axios.post('/api_todos/new' , task ).then(res => {
console.log(res.data );
window.location.href = '/todos';
});
},
}
});
</script>
You can’t perform that action at this time.