Skip to content

Commit 4bdb951

Browse files
committed
now with top 10 link.
1 parent 0bf41d1 commit 4bdb951

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

days/093-096-vuejs/movie_exploder/js/site.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
app = new Vue({
44
el: '#app',
55
data: {
6-
search_text: "initial value",
6+
search_text: null,
77
movies: movies_temp.hits
8+
},
9+
methods: {
10+
search: function() {
11+
let text = this.search_text
12+
console.log("Would have searched for " + text)
13+
},
14+
top_10: function() {
15+
console.log("Would have loaded top 10")
16+
}
817
}
918
})

days/093-096-vuejs/movie_exploder/views/index.html

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,19 @@
1313
<div class="card" id="app">
1414
<h1>Movie Exploder</h1>
1515

16-
<!--suppress HtmlFormInputWithoutLabel -->
17-
<input type="text" v-model="search_text">
16+
<div class="controls">
17+
<!--suppress HtmlFormInputWithoutLabel -->
18+
<input type="text" v-model="search_text"
19+
class="form-control"
20+
placeholder=" Search for a movie by keyword"
21+
@keyup.enter="search()"
22+
>
23+
24+
<div class="subcontrols">
25+
<a class="top_10" @click="top_10()">Top 10</a>
26+
</div>
27+
28+
</div>
1829

1930
<div class="movies">
2031
<div class="movie" v-for="m in movies">

0 commit comments

Comments
 (0)