Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
101 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<div> | ||
<h1> | ||
Hello World!!!! | ||
</h1> | ||
</div> | ||
</template> | ||
|
||
<script type="text/babel"> | ||
export default { | ||
computed: { | ||
} | ||
} | ||
</script> | ||
|
||
|
||
<style> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,70 @@ | ||
<template> | ||
<div style="font-size: 24px; text-align: center"> | ||
<div class="container smart-container"> | ||
<div class="row row-offcanvas row-offcanvas-right"> | ||
<div class="col-xs-12 col-sm-9"> | ||
<ul class="smart-artiles" id="articleList"> | ||
<li v-for="item in articleList"> | ||
<div class="point">+{{item.hits}}</div> | ||
<div class="card"> | ||
<h2><router-link :to="'/detail/'+item.id" class="nav-item-a">{{item.title}}</router-link></h2> | ||
<div> | ||
<ul class="actions"> | ||
<li> | ||
<time class="timeago">{{item.moduleName}}</time> | ||
</li> | ||
<li class="tauthor"> | ||
<a href="#" target="_blank" class="get">Sky</a> | ||
</li> | ||
<li><a :href="item.url" target="_blank">原文</a></li> | ||
<li> | ||
<span class="timeago">{{item.summary}}</span> | ||
</li> | ||
<li> | ||
<span class="timeago"></span> | ||
</li> | ||
</ul> | ||
<div style="font-size: 24px; text-align: center"> | ||
<div class="container smart-container"> | ||
<div class="row row-offcanvas row-offcanvas-right"> | ||
<div class="col-xs-12 col-sm-9"> | ||
<ul class="smart-artiles" id="articleList"> | ||
<div> | ||
<h3>DEMO</h3> | ||
<router-view name="demo"></router-view> | ||
</div> | ||
<li v-for="item in articleList"> | ||
<div class="point">+{{item.hits}}</div> | ||
<div class="card"> | ||
<h2> | ||
<router-link :to="'/detail/'+item.id" class="nav-item-a">{{item.title}} | ||
</router-link> | ||
</h2> | ||
<div> | ||
<ul class="actions"> | ||
<li> | ||
<time class="timeago">{{item.moduleName}}</time> | ||
</li> | ||
<li class="tauthor"> | ||
<a href="#" target="_blank" class="get">Sky</a> | ||
</li> | ||
<li><a :href="item.url" target="_blank">原文</a></li> | ||
<li> | ||
<span class="timeago">{{item.summary}}</span> | ||
</li> | ||
<li> | ||
<span class="timeago"></span> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
<div id="pagerBottom" class="smart-pager" v-if="isLoading"> | ||
<img src="../../asset/images/loading.gif"> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
<div id="pagerBottom" class="smart-pager" v-if="isLoading"> | ||
<img src="../../asset/images/loading.gif"> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
<style> | ||
</style> | ||
<script type="text/babel"> | ||
export default{ | ||
computed: { | ||
isLoading(){ | ||
return false; | ||
}, | ||
articleList() { | ||
return this.$store.state.articleList; | ||
} | ||
}, | ||
preFetch ({ state, dispatch, commit }) { | ||
return Promise.all([ | ||
dispatch('FETCH_ARTICLE_LIST') | ||
]) | ||
}, | ||
beforeMount() { | ||
return Promise.all([ | ||
this.$store.dispatch('FETCH_ARTICLE_LIST') | ||
]); | ||
export default { | ||
computed: { | ||
isLoading() { | ||
return false; | ||
}, | ||
articleList() { | ||
return this.$store.state.articleList; | ||
} | ||
}, | ||
preFetch({state, dispatch, commit}) { | ||
return Promise.all([ | ||
dispatch('FETCH_ARTICLE_LIST') | ||
]) | ||
}, | ||
beforeMount() { | ||
return Promise.all([ | ||
this.$store.dispatch('FETCH_ARTICLE_LIST') | ||
]); | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5260f08
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
egg-vue-webpack-boilerplate/app/web/framework/vue/app.js 里面只会匹配当前的路由,子路由没有获取,你可以查一下资料看看是否可以获取当前组件的自组件,然后调用子组件的prefech看看,而且你这里用到了动态加载,具体你可以研究 一下。
5260f08
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
我研究一下!