Skip to content

Commit

Permalink
docs: 📚️ update dnd docs (#1737)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector authored Jan 7, 2022
1 parent f0403ef commit 01f6346
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sites/x6-sites/docs/tutorial/basic/dnd.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ const dnd = new Addon.Dnd({
})
```

4.怎么获取放置到画布上节点的位置?

```ts
graph.on('node:added', ({ node }) => {
const { x, y } = node.position()
})
```

## Stencil

Stencil 是 `Addon` 命名空间中的一个插件,是在 Dnd 基础上的进一步封装,提供了一个类似侧边栏的 UI 组件,并支持分组、折叠、搜索等能力。
Expand Down
8 changes: 8 additions & 0 deletions sites/x6-sites/docs/tutorial/basic/dnd.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ const dnd = new Addon.Dnd({
})
```

4.怎么获取放置到画布上节点的位置?

```ts
graph.on('node:added', ({ node }) => {
const { x, y } = node.position()
})
```

## Stencil

Stencil 是 `Addon` 命名空间中的一个插件,是在 Dnd 基础上的进一步封装,提供了一个类似侧边栏的 UI 组件,并支持分组、折叠、搜索等能力。
Expand Down

0 comments on commit 01f6346

Please sign in to comment.