Skip to content

Commit 354cc08

Browse files
author
xrr2016
committed
🔥 edit List.vue
1 parent 13fe696 commit 354cc08

File tree

12 files changed

+458
-54
lines changed

12 files changed

+458
-54
lines changed

config/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ module.exports = {
2828
assetsSubDirectory: 'static',
2929
assetsPublicPath: '/',
3030
proxyTable: {
31-
'/movies': {
31+
'/api': {
3232
target: 'http://localhost:3000',
3333
changeOrigin: true
3434
},
35-
'/api': {
36-
target: 'http://api.douban.com/v2',
37-
changeOrigin: true,
38-
pathRewrite: {
39-
'^/api': ''
40-
}
41-
}
35+
// '/api': {
36+
// target: 'http://api.douban.com/v2',
37+
// changeOrigin: true,
38+
// pathRewrite: {
39+
// '^/api': ''
40+
// }
41+
// }
4242
},
4343
// CSS Sourcemaps off by default because relative paths are "buggy"
4444
// with this option, according to the CSS-Loader README

data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ function fetchData(count) {
4949
})
5050
}
5151

52-
fetchData(10)
52+
fetchData(50)

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>vue-express-mongodb</title>
5+
<title>Vue Express 前后端分离</title>
66
</head>
77
<body>
88
<div id="app"></div>

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
"scripts": {
88
"dev": "node build/dev-server.js",
99
"build": "node build/build.js",
10-
"server": "nodemon app.js"
10+
"server": "nodemon app.js",
11+
"start" : "node app.js"
1112
},
1213
"dependencies": {
1314
"axios": "^0.15.3",
1415
"body-parser": "^1.16.1",
1516
"express": "^4.14.1",
17+
"jquery": "^3.1.1",
1618
"mongoose": "^4.8.2",
1719
"toastr": "^2.1.2",
1820
"vue": "^2.1.10",

router/movie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const router = express.Router()
33
const Movie = require('../models/movie')
44

55
// 查询所有电影
6-
router.get('/movies', (req, res) => {
6+
router.get('/movie', (req, res) => {
77
Movie.find({})
88
.sort({ update_at : -1})
99
.then(movies => {

src/App.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<template>
22
<div id="app">
3-
<img src="./assets/logo.png">
3+
<!-- <h2 class="md-dispaly-4 title">{{ title }}</h2> -->
44
<router-view></router-view>
55
</div>
66
</template>
77

88
<script>
99
export default {
10-
name: 'app'
10+
name: 'app',
11+
data(){
12+
return {
13+
title : 'Movie List'
14+
}
15+
}
1116
}
1217
</script>
1318

@@ -17,7 +22,13 @@ export default {
1722
-webkit-font-smoothing: antialiased;
1823
-moz-osx-font-smoothing: grayscale;
1924
text-align: center;
20-
color: #2c3e50;
21-
margin-top: 60px;
25+
display: flex;
26+
flex-direction: column;
27+
justify-content: center;
28+
align-items: center;
29+
margin-top: 20px;
30+
}
31+
.title{
32+
letter-spacing: 1px;
2233
}
2334
</style>

0 commit comments

Comments
 (0)