mirror of
https://github.com/NetEase/tango.git
synced 2026-08-28 17:41:30 +08:00
28 lines
475 B
Plaintext
28 lines
475 B
Plaintext
# Hooks 钩子方法
|
|
|
|
设计器提供了一组 Hooks 用于快速获取设计器的各种状态。
|
|
|
|
import TypesTable from '@site/src/components/TypesTable';
|
|
|
|
## useWorkspace
|
|
|
|
获取工作区状态。
|
|
|
|
```js
|
|
// App 需要放置在 Designer 容器中
|
|
function App() {
|
|
const workspace = useWorkspace();
|
|
// do what you want
|
|
}
|
|
```
|
|
|
|
## useDesigner
|
|
|
|
```js
|
|
// App 需要放置在 Designer 容器中
|
|
function App() {
|
|
const designer = useDesigner();
|
|
// do what you want
|
|
}
|
|
```
|