Skip to content

Commit

Permalink
docs: add useScope
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj authored and jiangzm committed Dec 7, 2020
1 parent 796da5d commit 004eeed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,16 @@ const router = useRouter() // { path: '', params: { ... } }

`useRouter` 是 Taro 专有的 Hook,等同于页面为类时的 `this.$router`

### `useScope`

> `1.3.20` 开始支持
```jsx
const scope = useScope()
```

`useScope` 是 Taro 专有的 Hook,等同于页面为类时的 `this.$scope`

## 页面及组件中相关属性设置

在 Taro 中,你可以为页面及组件设置一些属性来达到一些特殊的目的,例如 `config` 设置配置等等,在前面章节你已经学会如何在类中进行相关设置,同样的,使用 Hooks 时你也可以进行相关设置来达到和使用类一样的效果。
Expand Down

0 comments on commit 004eeed

Please sign in to comment.