Skip to content

Commit

Permalink
docs: fix the code error of LOCALS in view.md (#2464)
Browse files Browse the repository at this point in the history
in the code of "locals", the key of value "egg" should be "name".
  • Loading branch information
zjz19901029 authored and popomore committed Apr 26, 2018
1 parent f341b9f commit 4377853
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/source/en/core/view.md
Expand Up @@ -185,7 +185,7 @@ Instead, simply call `ctx.render(name, data)`:

```js
ctx.app.locals = { appName: 'showcase' };
const data = { user: 'egg' };
const data = { name: 'egg' };

// will auto merge `data` to `ctx.locals`, output: egg - showcase
await ctx.renderString('{{ name }} - {{ appName }}', data);
Expand Down
2 changes: 1 addition & 1 deletion docs/source/zh-cn/core/view.md
Expand Up @@ -161,7 +161,7 @@ console.log(ctx.locals); // { a: 1, b: 2, c: 3, d: 4 }

```js
ctx.app.locals = { appName: 'showcase' };
const data = { user: 'egg' };
const data = { name: 'egg' };

// will auto merge `data` to `ctx.locals`, output: egg - showcase
await ctx.renderString('{{ name }} - {{ appName }}', data);
Expand Down

0 comments on commit 4377853

Please sign in to comment.