docs: 📚️ usage from CDN links

This commit is contained in:
bubkoo
2021-01-14 14:36:00 +08:00
parent b28f05d24a
commit c4159bd956
3 changed files with 9 additions and 2 deletions

View File

@ -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({

View File

@ -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'),

View File

@ -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'),