File tree Expand file tree Collapse file tree 4 files changed +49
-8
lines changed Expand file tree Collapse file tree 4 files changed +49
-8
lines changed Original file line number Diff line number Diff line change @@ -49,4 +49,4 @@ function fetchData(count) {
49
49
} )
50
50
}
51
51
52
- fetchData ( 50 )
52
+ fetchData ( 5 )
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" >
3
- <mu-appbar title =" Title" >
4
- <mu-icon-button icon =' menu' slot =" left" />
5
- <mu-icon-button icon =' expand_more' slot =" right" />
3
+ <mu-appbar >
4
+ {{ title }}
5
+ <mu-icon-menu icon =" menu" class =" icon-menu" >
6
+ <mu-menu-item title =" Help" />
7
+ <mu-menu-item title =" Sign out" />
8
+ </mu-icon-menu >
6
9
</mu-appbar >
7
10
<router-view ></router-view >
8
11
</div >
@@ -13,7 +16,7 @@ export default {
13
16
name: ' app' ,
14
17
data (){
15
18
return {
16
- title : ' Movie List '
19
+ title : ' 电影列表 '
17
20
}
18
21
}
19
22
}
@@ -33,4 +36,8 @@ export default {
33
36
.title {
34
37
letter-spacing : 1px ;
35
38
}
39
+ .icon-menu {
40
+ float : right ;
41
+ margin-right : 30px ;
42
+ }
36
43
</style >
Original file line number Diff line number Diff line change 1
1
<template lang="html">
2
2
<div class =" list" >
3
- List.vue
3
+ <mu-table :fixedHeader =" true" :showCheckbox =" false" >
4
+ <mu-thead >
5
+ <mu-tr >
6
+ <mu-th >ID</mu-th>
7
+ <mu-th >电影海报</mu-th>
8
+ <mu-th >电影名称</mu-th>
9
+ <mu-th >上映年份</mu-th>
10
+ <mu-th >主要演员</mu-th>
11
+ <mu-th >评分</mu-th>
12
+ <mu-th >操作</mu-th>
13
+ </mu-tr>
14
+ </mu-thead>
15
+ <mu-tbody >
16
+ <mu-tr v-for =" movie of movies" >
17
+ <mu-td >{{ movie.id }}</mu-td>
18
+ <mu-td ><img :src =" movie.image" :title =" movie.original_title" ></mu-td>
19
+ <mu-td>{{ movie.title }}</mu-td>
20
+ <mu-td >{{ movie.year }}</mu-td>
21
+ <mu-td >
22
+ <p v-for =" cast of movie.casts" >{{ cast.name }}</p>
23
+ </mu-td>
24
+ <mu-td >{{ movie.rating }}</mu-td>
25
+ <mu-td >
26
+ <mu-raised-button label =" 修改" primary />
27
+ <mu-raised-button label =" 删除" secondary />
28
+ </mu-td>
29
+ </mu-tr>
30
+ </mu-tbody>
31
+ </mu-table>
32
+ <mu-float-button icon =" add" class =" add-movie-btn" />
4
33
</div>
5
34
</template >
6
35
@@ -19,7 +48,6 @@ export default {
19
48
this .$http .get (' /api/movie' )
20
49
.then (res => {
21
50
this .movies = res .data
22
- console .dir (res .data [0 ])
23
51
})
24
52
.catch (err => {
25
53
toastr .error (` ${ err .message } ` ,' ERROR!' )
@@ -33,4 +61,8 @@ export default {
33
61
<style lang="css">
34
62
.list {
35
63
}
64
+ .add-movie-btn {
65
+ position : fixed ;
66
+ bottom : 50px ;
67
+ }
36
68
</style >
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ toastr.options = {
33
33
// const prefix = "https://images.weserv.nl/?url="
34
34
// return prefix + url
35
35
// })
36
-
36
+ Vue . filter ( 'castsToString' , ( casts ) => {
37
+ return casts . map ( ( item ) => { return item . name } ) . toString ( ) . replace ( / \, / g, "\n" )
38
+ } )
37
39
38
40
/* eslint-disable no-new */
39
41
new Vue ( {
You can’t perform that action at this time.
0 commit comments