Skip to content

Commit ec2a04c

Browse files
committed
Your turn steps.
1 parent a42e863 commit ec2a04c

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

days/093-096-vuejs/your-turn/README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Days 93-96 Frontend Web Apps with Vue.js
22

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.
44

55
## Day 1: Watch the first half of the video lessons
66

@@ -10,7 +10,7 @@ The first day of this 4-day block is to watch the videos. You should watch them
1010

1111
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.
1212

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.
1414

1515
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/).
1616

@@ -53,13 +53,17 @@ To bind bi-directionally, use the model on elements that can change (input, sele
5353

5454
Play around with this in your app to see that it's working.
5555

56+
### Looping over data with repeated HTML blocks
57+
5658
To loop over data, use `v-for`, for exampe:
5759

5860
```
5961
<div class="movie" v-for="m in movies">
6062
</div>
6163
```
6264

65+
### Conditional rendering
66+
6367
For conditional rendering, it's `v-if` `and v-else`:
6468

6569
```
@@ -100,11 +104,34 @@ With all of this background info. Go ahead and write the app to work up to the p
100104

101105
## Day 3: Watch videos second half
102106

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).
104108

105109
## Day 4: Round out the app with the real service
106110

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!
108135

109136
### Time to share what you've accomplished!
110137

@@ -113,5 +140,3 @@ Be sure to share your last couple of days work on Twitter or Facebook. Use the h
113140
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.
114141

115142
*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).*
116-
117-

0 commit comments

Comments
 (0)