Authored by shuaiguo

feat(笔记详情):增加接口调用

... ... @@ -51,6 +51,11 @@ export default {
ArticleImage,
HorizontalSlide
},
props: {
articleId: {
required: true
}
},
data() {
return {
imageList: [
... ... @@ -66,6 +71,11 @@ export default {
userName: 'MOMO草'
};
},
asyncData({store, router}) {
const articleId = router.params.articleId;
store.dispatch('/article/')
},
};
</script>
... ...
... ... @@ -6,7 +6,12 @@ export default [
},
{
name: 'ArticleDetail',
path: '/xianyu/article/detail',
component: () => import(/* webpackChunkName: "articleDetail" */ './articleDetail')
path: '/xianyu/article/detail/:articleId.html',
component: () => import(/* webpackChunkName: "articleDetail" */ './articleDetail'),
props({params}) {
return {
articleId: parseInt(params.articleId, 10)
};
}
}
];
... ...
... ... @@ -5,6 +5,9 @@ export default function() {
namespaced: true,
state: {
detailInfo: {}
},
actions: {
[FETCH_DETAIL_INFO]() {}
}
};
}
... ...