十二章 实战篇

2019-11-07  本文已影响0人  kzc爱吃梨

1 cnode社区的基本构架

组件:

2 从0开始实战

2.1 Header组件

2.2 PostList组件

API接口:https://cnodejs.org/api/v1/topics 获取帖子列表
limitpage
拿到的参数分析
头像:author.avatar_url
回复量/浏览量 :reply_count/visit_count
帖子的标题:title
需要使用到过滤器:
时间:last_reply_at
帖子分类:


2.3 Article组件

API https://cnodejs.org/api/v1/topic/ + 帖子ID

2.4 USerinfo组件

API https://cnodejs.org/api/v1/user/+ username
http://localhost:8081/#/userinfo/aojiaotage–用户列表页
=》》》
http://localhost:8081/#/topic/5afe26730a36e5312d6ed257&author=aojiaotage
http://localhost:8081/#/topic/5afe26730a36e5312d6ed257&author=aojiaotage
—­》》》
http://localhost:8081/#/topic/57ff46f5fdf3bd3d651185bf&author=aojiaotage


最后提交到GitHub上
第一步:

npm run build

第二步:

module.exports = {
  publicPath: process.env.NODE_ENV === 'production'
    ? '/my-project/'
    : '/'
}
上一篇 下一篇

猜你喜欢

热点阅读