Skip to content

Commit 0287b62

Browse files
author
ming.xie
committed
新增插件的依赖,升级MD说明
1 parent 7918993 commit 0287b62

File tree

8 files changed

+53
-25
lines changed

8 files changed

+53
-25
lines changed

README.md

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
<img width="112" alt="screen shot 2016-10-25 at 2 37 27 pm" src="https://cloud.githubusercontent.com/assets/13041/19686250/971bf7f8-9ac0-11e6-975c-188defd82df1.png">
2-
3-
[![NPM version](https://img.shields.io/npm/v/next.svg)](https://www.npmjs.com/package/next)
4-
[![Build Status](https://travis-ci.org/zeit/next.js.svg?branch=master)](https://travis-ci.org/zeit/next.js)
5-
[![Build status](https://ci.appveyor.com/api/projects/status/gqp5hs71l3ebtx1r/branch/master?svg=true)](https://ci.appveyor.com/project/arunoda/next-js/branch/master)
6-
[![Coverage Status](https://coveralls.io/repos/zeit/next.js/badge.svg?branch=master)](https://coveralls.io/r/zeit/next.js?branch=master)
7-
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/next-js)
1+
<p align="center">
2+
<img alt="图片" src="static/images/next.png">
3+
<img width="140" alt="图片" src="static/images/antd.png">
4+
<img width="120" alt="图片" src="static/images/mobx.png">
5+
</p>
86

97
Next.js是服务端渲染呈现的React应用程序的简约框架,这个项目通过配置Next.js+Mbox实现的一个Demo.
108

11-
---
129
## 模块
1310

1411
+ react-helmet
@@ -20,16 +17,40 @@ Next.js是服务端渲染呈现的React应用程序的简约框架,这个项目
2017
+ next-routes
2118
+ antd v3.9.2
2219

20+
## 预览图
21+
<p align="center">
22+
<img alt="图片" src="static/images/Screenshot from 2019-04-22 11-51-34.png">
23+
<img alt="图片" src="static/images/Screenshot from 2019-04-22 11-51-48.png">
24+
</p>
25+
26+
2327
## 功能
2428

25-
+ SSR
26-
+ Automatic code splitting
29+
+ 服务端渲染
30+
+ js按需加载
31+
+ Mobx状态管理器
2732

2833
## 其它
34+
2935
### 使用了动态路由跳转使用next-routes提供的方法
30-
+ Link example
3136

32-
```bash
37+
#### 路由声明`routers/index.js`
38+
39+
```js
40+
const routes = require('next-routes');
41+
42+
module.exports = routes()
43+
.add('demo', '/demo/:id', 'demo')
44+
.add('nestedRouter', '/nested_router', 'nestedRouter')
45+
.add('link1', '/nested_router/link1', 'nestedRouter/link1')
46+
.add('link2', '/nested_router/link2', 'nestedRouter/link2')
47+
.add('netWork', '/netWork', 'netWork')
48+
.add('structChart', '/struct_chart', 'structChart')
49+
```
50+
51+
#### 使用`Link`路由跳转
52+
53+
```js
3354
import {Link} from '../routes'
3455

3556
export default () => (
@@ -38,16 +59,16 @@ export default () => (
3859
<Link route='blog' params={{slug: 'hello-world'}}>
3960
<a>Hello world</a>
4061
</Link>
41-
or
62+
或者
4263
<Link route='/blog/hello-world'>
4364
<a>Hello world</a>
4465
</Link>
4566
</div>
4667
)
4768
```
48-
+ Router example
69+
#### 使用`Router`跳转路由
4970

50-
```bash
71+
```js
5172
import React from 'react'
5273
import {Router} from '../routes'
5374

@@ -73,9 +94,7 @@ export default class Blog extends React.Component {
7394
### 安装
7495

7596
```bash
76-
npm install
77-
or
78-
yarn(推荐)
97+
npm install 或 yarn(推荐)
7998
```
8099
### 开发环境运行
81100
```bash

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next_react",
3-
"version": "1.0.0",
3+
"version": "1.2.1",
44
"description": "A Next Project",
55
"main": "server.js",
66
"dependencies": {
@@ -24,7 +24,8 @@
2424
"@babel/plugin-proposal-class-properties": "^7.1.0",
2525
"@babel/plugin-proposal-decorators": "^7.1.0",
2626
"nodemon": "^1.18.3",
27-
"postcss-css-variables": "^0.9.0"
27+
"postcss-css-variables": "^0.9.0",
28+
"lodash": ">=4.17.11"
2829
},
2930
"scripts": {
3031
"dev": "nodemon server.js",
Loading
Loading

static/images/antd.png

533 KB
Loading

static/images/mobx.png

26.1 KB
Loading

static/images/next.png

6.82 KB
Loading

yarn.lock

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5443,15 +5443,15 @@ react-slick@~0.23.2:
54435443
prettier "^1.14.3"
54445444
resize-observer-polyfill "^1.5.0"
54455445

5446-
react@^16.6.1:
5447-
version "16.7.0"
5448-
resolved "https://registry.yarnpkg.com/react/-/react-16.7.0.tgz#b674ec396b0a5715873b350446f7ea0802ab6381"
5449-
integrity sha512-StCz3QY8lxTb5cl2HJxjwLFOXPIFQp+p+hxQfc8WE0QiLfCtIlKj8/+5tjjKm8uSTlAW+fCPaavGFS06V9Ar3A==
5446+
react@^16.6.7:
5447+
version "16.8.6"
5448+
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
5449+
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
54505450
dependencies:
54515451
loose-envify "^1.1.0"
54525452
object-assign "^4.1.1"
54535453
prop-types "^15.6.2"
5454-
scheduler "^0.12.0"
5454+
scheduler "^0.13.6"
54555455

54565456
read-pkg@^2.0.0:
54575457
version "2.0.0"
@@ -5750,6 +5750,14 @@ scheduler@^0.12.0:
57505750
loose-envify "^1.1.0"
57515751
object-assign "^4.1.1"
57525752

5753+
scheduler@^0.13.6:
5754+
version "0.13.6"
5755+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
5756+
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
5757+
dependencies:
5758+
loose-envify "^1.1.0"
5759+
object-assign "^4.1.1"
5760+
57535761
schema-utils@^0.4.4, schema-utils@^0.4.5:
57545762
version "0.4.7"
57555763
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"

0 commit comments

Comments
 (0)