...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
<Article
|
|
|
ref="article"
|
|
|
type="article"
|
|
|
:thumbs="articleThumbList"
|
|
|
share
|
|
|
:on-fetch="onFetch">
|
|
|
</Article>
|
...
|
...
|
@@ -12,7 +13,7 @@ import {get} from 'lodash'; |
|
|
import Article from './components/article/article';
|
|
|
import ArticleItem from './components/article/article-item';
|
|
|
import {createNamespacedHelpers} from 'vuex';
|
|
|
const {mapActions} = createNamespacedHelpers('article');
|
|
|
const {mapState, mapActions} = createNamespacedHelpers('article');
|
|
|
|
|
|
export default {
|
|
|
name: 'ArticleSharePage',
|
...
|
...
|
@@ -31,6 +32,21 @@ export default { |
|
|
this.init();
|
|
|
}
|
|
|
},
|
|
|
async serverPrefetch() {
|
|
|
const articleId = parseInt(this.id, 10);
|
|
|
|
|
|
if (!articleId) {
|
|
|
return;
|
|
|
}
|
|
|
return this.fetchArticleList({
|
|
|
articleId,
|
|
|
limit: 2,
|
|
|
thumb: true
|
|
|
});
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['articleThumbList'])
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['fetchArticleList']),
|
|
|
init() {
|
...
|
...
|
|