You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: days/093-096-vuejs/your-turn/README.md
+31-6Lines changed: 31 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Days 93-96 Frontend Web Apps with Vue.js
2
2
3
-
In this your-turn, you will deploy one of the web apps that you have created during this course.
3
+
In this your-turn, you will developer the web app we created during the presentation.
4
4
5
5
## Day 1: Watch the first half of the video lessons
6
6
@@ -10,7 +10,7 @@ The first day of this 4-day block is to watch the videos. You should watch them
10
10
11
11
Now that you know some Vue.js, it's time to put it to use! Find the starter project in the folder `your_movie_exploder` (adjacent to this file). Open that in your editor.
12
12
13
-
If you are using PyCharm or WebStorm, be sure that the Vue.js plugin is installed and enabled. We have already confirmed this version of the site as an `npm` package and installed the required dependencies. That means the Vue.js plugin should just work in the JetBrains tools, and maybe others too.
13
+
If you are using PyCharm or WebStorm, be sure that the Vue.js plugin is installed and enabled. We have already configured this version of the site as an `npm` package and installed the required dependencies. That means the Vue.js plugin should just work in the JetBrains tools, and maybe others too.
14
14
15
15
Because APIs can be so ephemeral and their schema unstable, we have decided to use the exact same app and service over at [movie_service.talkpython.fm](http://movie_service.talkpython.fm/).
16
16
@@ -53,13 +53,17 @@ To bind bi-directionally, use the model on elements that can change (input, sele
53
53
54
54
Play around with this in your app to see that it's working.
55
55
56
+
### Looping over data with repeated HTML blocks
57
+
56
58
To loop over data, use `v-for`, for exampe:
57
59
58
60
```
59
61
<div class="movie" v-for="m in movies">
60
62
</div>
61
63
```
62
64
65
+
### Conditional rendering
66
+
63
67
For conditional rendering, it's `v-if``and v-else`:
64
68
65
69
```
@@ -100,11 +104,34 @@ With all of this background info. Go ahead and write the app to work up to the p
100
104
101
105
## Day 3: Watch videos second half
102
106
103
-
...
107
+
This day is just watching the second set of videos. You should watch them from Lecture 19 (Searching movies via the API) -> (Your turn, day 4).
104
108
105
109
## Day 4: Round out the app with the real service
106
110
107
-
...
111
+
Down to the last day! Now you can toss that fake data and start using the API.
112
+
113
+
We will be using the [axios library](https://github.com/axios/axios). You can call any GET HTTP endpoint via something like this:
114
+
115
+
```
116
+
let that = this
117
+
axios.get(url)
118
+
.then(function (response) { // handle success
119
+
// Work with response.data
120
+
})
121
+
.catch(function (error) { // handle error
122
+
console.log("ERROR! " + error);
123
+
})
124
+
```
125
+
126
+
Remeber our service is located at [movie_service.talkpython.fm](http://movie_service.talkpython.fm/). Use this type of code above to implement three methods and bind those methods to the revelant events:
127
+
128
+
* search()
129
+
* top_10()
130
+
* load_genre(genre)
131
+
132
+
Also use it to get the genres from the service.
133
+
134
+
Once you have this working. Go ahead and freestyle with the app if you have some extra time. Congrats, you're done!
108
135
109
136
### Time to share what you've accomplished!
110
137
@@ -113,5 +140,3 @@ Be sure to share your last couple of days work on Twitter or Facebook. Use the h
113
140
Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.
114
141
115
142
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofweb-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofweb-with-python-course/pulls).*
0 commit comments