Skip to content

Commit f13de37

Browse files
committedJul 13, 2017
Added functionality to submit form
1 parent d8041a0 commit f13de37

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/App.vue

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="col-xs-12">
55
<h1>Add Blog Post</h1>
66

7-
<form>
7+
<form @submit.prevent="isSubmitted = true">
88
<div class="form-group">
99
<label for="title">Title</label>
1010
<input type="text" class="form-control" id="title" v-model.trim="post.title">
@@ -46,11 +46,13 @@
4646
<option v-for="series in formData.series" :value="series">{{ series }}</option>
4747
</select>
4848
</div>
49+
50+
<input type="submit" class="btn btn-primary" value="Publish">
4951
</form>
5052

5153
<hr>
5254

53-
<table class="table table-striped">
55+
<table class="table table-striped" v-if="isSubmitted">
5456
<thead>
5557
<tr>
5658
<td class="col-xs-6"><strong>Field</strong></td>
@@ -97,6 +99,7 @@
9799
export default {
98100
data() {
99101
return {
102+
isSubmitted: false,
100103
post: {
101104
title: '',
102105
content: '',

0 commit comments

Comments
 (0)
Please sign in to comment.