Skip to content

Commit c3e1b4b

Browse files
author
Shaun Pelling
committed
added lesson 31 code
1 parent 158c041 commit c3e1b4b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/addBlog.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
<label>Cheese</label>
1818
<input type="checkbox" value="cheese" v-model="blog.categories" />
1919
</div>
20+
<label>Author:</label>
21+
<select v-model="blog.author">
22+
<option v-for="author in authors">{{ author }}</option>
23+
</select>
2024
</form>
2125
<div id="preview">
2226
<h3>Preview blog</h3>
@@ -27,6 +31,7 @@
2731
<ul>
2832
<li v-for="category in blog.categories">{{ category }}</li>
2933
</ul>
34+
<p>Author: {{ blog.author }}</p>
3035
</div>
3136
</div>
3237
</template>
@@ -40,8 +45,10 @@ export default {
4045
blog: {
4146
title: '',
4247
content: '',
43-
categories: []
44-
}
48+
categories: [],
49+
author: ''
50+
},
51+
authors: ['The Net Ninja', 'The Angular Avenger', 'The Vue Vindicator']
4552
}
4653
},
4754
methods: {
@@ -81,5 +88,6 @@ h3{
8188
}
8289
#checkboxes label{
8390
display: inline-block;
91+
margin-top: 0;
8492
}
8593
</style>

0 commit comments

Comments
 (0)