Skip to content

Commit

Permalink
doc: update nextjs.md (jaywcjlove#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lmmmmmm-bb authored Jan 17, 2023
1 parent 28066ae commit 6900980
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default Blog
- Next.js 在后台触发页面的重新生成
- 一旦页面生成成功,Next.js 将使缓存失效并显示更新后的页面。如果后台重新生成失败,旧页面仍将保持不变

### 使用 useeffect 客户端数据获取
### 使用 useEffect 客户端数据获取

```jsx
import { useState, useEffect } from 'react'
Expand Down Expand Up @@ -399,7 +399,7 @@ const path = require('path')

module.exports = {
sassOptions: {
includePaths:
includePaths:
[path.join(__dirname, 'styles')],
},
}
Expand Down Expand Up @@ -1336,7 +1336,7 @@ NEXT_PUBLIC_ANALYTICS_ID=abcdefghijk
// pages/index.js
import setupAnalyticsService from '../lib/my-analytics-service'

//
//
// 它将在构建时转换为 `setupAnalyticsService('abcdefghijk')`
setupAnalyticsService(process.env.NEXT_PUBLIC_ANALYTICS_ID)

Expand Down Expand Up @@ -1528,11 +1528,11 @@ export default function Home() {
```js
// GET `/post` (empty object)
{ }
{ }
// `GET /post/a` (single-element array)
{ "slug": ["a"] }
{ "slug": ["a"] }
// `GET /post/a/b` (multi-element array)
{ "slug": ["a", "b"] }
{ "slug": ["a", "b"] }
```
### 事件执行调整页面
Expand Down

0 comments on commit 6900980

Please sign in to comment.