Skip to content

Commit

Permalink
全部修改成异步组件
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangjiu committed Jul 15, 2016
1 parent 9172dd1 commit d8b189c
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 47 deletions.
9 changes: 6 additions & 3 deletions FE/src/components/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
<script type="text/babel">
import {updateHeadline, getTags, getTagContentList} from '../vuex/actions'
import {tags} from '../vuex/getters'
import TagContentList from './TagContentList'
export default {
components: {
TagContentList
TagContentList: function (resolve) {
require(['./TagContentList'], resolve)
}
},
data () {
return {
Expand Down Expand Up @@ -92,10 +93,12 @@
background-color: #efefef;
color: #424242;
}
@media screen and (max-width: 768px) {
.tagset li a {
padding:.1rem 1rem;
padding: .1rem 1rem;
}
.tagset li {
margin: .2rem;
}
Expand Down
20 changes: 12 additions & 8 deletions FE/src/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Vue from 'vue'
import App from './App.vue'
import Home from './components/Home'
import About from './components/About'
import Tags from './components/Tags'
import Article from './components/Article'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'

Expand All @@ -16,17 +12,25 @@ const router = new VueRouter()
// 路由map
router.map({
'/home': {
component: Home
component: function (resolve) {
require(['./components/Home'], resolve)
}
},
'/about': {
component: resolve => resolve(About)
component: function (resolve) {
require(['./components/About'], resolve)
}
},
'/tags': {
component: resolve => resolve(Tags)
component: function (resolve) {
require(['./components/Tags'], resolve)
}
},
'/article/:id': {
name: 'article',
component: resolve => resolve(Article)
component: function (resolve) {
require(['./components/Article'], resolve)
}
}

})
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=keywords content=将就,博客,前端,vue.js,北邮,健身><meta name=description content=将就的个人博客,byr/前端/健身><meta name=robots content=all><meta name=viewport content="width=device-width,initial-scale=1"><meta name=author content=将就,1021808625@qq.com><meta name=copyright content=将就><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><title>将就的博客</title><link rel="shortcut icon" href=/favicon.ico><link href=/static/css/app.c602ae5285c63b9866f6f6459f3ee39b.css rel=stylesheet></head><body><div id=app><app></app></div><script type=text/javascript src=/static/js/manifest.abbbc8ba119e1145383e.js></script><script type=text/javascript src=/static/js/vendor.e4225a6cbfed0163bc99.js></script><script type=text/javascript src=/static/js/app.4d8368246ee9eeac940c.js></script></body></html>
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=keywords content=将就,博客,前端,vue.js,北邮,健身><meta name=description content=将就的个人博客,byr/前端/健身><meta name=robots content=all><meta name=viewport content="width=device-width,initial-scale=1"><meta name=author content=将就,1021808625@qq.com><meta name=copyright content=将就><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><title>将就的博客</title><link rel="shortcut icon" href=/favicon.ico><link href=/static/css/app.8a073872d33e1a52eb3d456599d2b5ff.css rel=stylesheet></head><body><div id=app><app></app></div><script type=text/javascript src=/static/js/manifest.7fb48771be8647fdcaf1.js></script><script type=text/javascript src=/static/js/vendor.b1e90af702073ff257d5.js></script><script type=text/javascript src=/static/js/app.141f9c19c9c5b642298c.js></script></body></html>
2 changes: 0 additions & 2 deletions public/static/css/app.c602ae5285c63b9866f6f6459f3ee39b.css

This file was deleted.

Loading

0 comments on commit d8b189c

Please sign in to comment.