Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
docs: fix App data 的声明的错误和重复的片段 (#165)
Browse files Browse the repository at this point in the history
* docs: fix App data 的声明的错误

* Update sharing-state.md
  • Loading branch information
chasewoo authored and yesmeck committed Aug 27, 2019
1 parent c62d6ad commit 0b9d32c
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions docs/advanced-guide/sharing-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ order: 43
```js
// app.js

export default class App {
data: {
export default class App {
data = {
name: 'remax'
}
}
Expand All @@ -34,24 +34,6 @@ export default () => {
return <View onClick={gotoB}>goto B</View>;
}

// pages/A/index.js

import { navigateTo, View } from 'remax/wechat';

const app = getApp();

export default () => {
const gotoB = () => {
app.data.name = 'B';

navigateTo({
url: 'pages/B/index'
})
}

return <View onClick={gotoB}>goto B</View>;
}

// pages/B/index.js
import { View } from 'remax/wechat';

Expand Down

0 comments on commit 0b9d32c

Please sign in to comment.