docs: 📚️ usage from CDN links
This commit is contained in:
@ -72,7 +72,10 @@ For production, we recommend linking to a specific version number to avoid unexp
|
||||
**Step 2**: render nodes and edges.
|
||||
|
||||
```ts
|
||||
// import from node_modules
|
||||
import { Graph } from '@antv/x6'
|
||||
// or use the global variable `X6` exported from CDN links
|
||||
// const { Graph } = X6
|
||||
|
||||
// Create an instance of Graph.
|
||||
const graph = new Graph({
|
||||
|
@ -2,8 +2,8 @@
|
||||
title: 快速上手
|
||||
order: 1
|
||||
redirect_from:
|
||||
- /en/docs
|
||||
- /en/docs/tutorial
|
||||
- /zh/docs
|
||||
- /zh/docs/tutorial
|
||||
---
|
||||
|
||||
## 安装
|
||||
@ -97,6 +97,8 @@ const data = {
|
||||
|
||||
```ts
|
||||
import { Graph } from '@antv/x6';
|
||||
// 使用 CDN 引入时暴露了 X6 全局变量
|
||||
// const { Graph } = X6
|
||||
|
||||
const graph = new Graph({
|
||||
container: document.getElementById('container'),
|
||||
|
@ -97,6 +97,8 @@ const data = {
|
||||
|
||||
```ts
|
||||
import { Graph } from '@antv/x6';
|
||||
// 使用 CDN 引入时暴露了 X6 全局变量
|
||||
// const { Graph } = X6
|
||||
|
||||
const graph = new Graph({
|
||||
container: document.getElementById('container'),
|
||||
|
Reference in New Issue
Block a user