next-blog:nextjs + koa + mongodb =>博客

时间:2021-05-14 00:14:57
【文件属性】:
文件名称:next-blog:nextjs + koa + mongodb =>博客
文件大小:405KB
文件格式:ZIP
更新时间:2021-05-14 00:14:57
JavaScript 环境 MongoDB, nodejs>8, webstorm > 2019.2 使用 npm i npm start 介绍 koa next blog 截图 主页 详情页 文章管理 发文 标签管理 文档 中文文档 github next 相关知识点 建议看官方的文档和demo。demo有100多种例子供参考。examples。这里只是做一些补充。 nextjs使用dotenv设置环境变量。参考nextjs官方demo _document.js 服务端渲染会用到。如果用到统计代码,可以写在这里。 _app.js 页面布局,相当于layout.js。 重写getInitialProps方法。这样每个页面切换的时候都会调用这个方法给页面传入自定义数据,比如初始化store。前提是要执行特定的代码,保证不会丢失props。代码如下: static async getInitialProps ({
【文件预览】:
next-blog-master
----.gitignore(75B)
----.babelrc(273B)
----app()
--------api()
--------components()
--------models()
--------util()
--------lib()
--------controllers()
--------styles()
--------store()
----package.json(2KB)
----package-lock.json(536KB)
----next.config.js(3KB)
----ecosystem.config.js(249B)
----LICENSE(1KB)
----doc()
--------screenshots()
----.env(219B)
----static()
--------favicon.png(3KB)
----.eslintrc.js(3KB)
----README.md(6KB)
----config()
--------index.js(383B)
--------env()
----.eslintignore(34B)
----test-connect.js(485B)
----pages()
--------login.js(2KB)
--------admin()
--------index.js(4KB)
--------detail.js(3KB)
--------_document.js(948B)
--------_app.js(659B)
--------about.js(425B)
--------_error.js(438B)
----test()
--------test-redis.js(292B)
--------testQQAuth.html(554B)
--------test-connect.js(645B)
----.editorconfig(146B)
----server.js(4KB)

网友评论