1 | <p align="center">
|
2 | <img src="https://raw.githubusercontent.com/denaro-org/v-charts2/main/docs/.vuepress/public/favicon.ico" alt="mark text" width="100" height="100">
|
3 | </p>
|
4 |
|
5 | <h3 align="center">@v-chart2/sankey</h3>
|
6 |
|
7 | <p align="center">
|
8 | <a href="https://www.npmjs.com/package/@v-charts2/sankey" target="_blank"><img alt="npm version" src="https://img.shields.io/npm/v/@v-charts2/sankey"></a>
|
9 | <a href="https://packagephobia.com/result?p=@v-charts2/sankey" target="_blank"><img alt="install size" src="https://packagephobia.now.sh/badge?p=@v-charts2/sankey"></a>
|
10 | <a href="https://github.com/denaro-org/v-charts2/stargazers" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/denaro-org/v-charts2"></a>
|
11 | <a href="https://github.com/denaro-org/v-charts2/issues" target="_blank"><img alt="GitHub issues" src="https://img.shields.io/github/issues/denaro-org/v-charts2"></a>
|
12 | <br />
|
13 | <a href="https://www.jsdelivr.com/package/npm/@v-charts2/sankey" target="_blank"><img alt="jsdelivr" src="https://data.jsdelivr.com/v1/package/npm/@v-charts2/sankey/badge"></a>
|
14 | <a href="https://www.npmjs.com/package/@v-charts2/sankey" target="_blank"><img alt="npm" src="https://img.shields.io/node/v/@v-charts2/sankey"></a>
|
15 | <a href="https://github.com/denaro-org/v-charts2/blob/main/LICENSE" target="_blank"><img alt="NPM" src="https://img.shields.io/npm/l/@v-charts2/sankey"></a>
|
16 | </p>
|
17 |
|
18 | > :tada: 桑葚图
|
19 |
|
20 | ### 下载
|
21 |
|
22 | ```bash
|
23 | pnpm add @v-charts2/sankey
|
24 | # or
|
25 | npm install @v-charts2/sankey
|
26 | ```
|
27 |
|
28 | ### 安装
|
29 |
|
30 | 当你当前的打包工具为 webpack 时, 推荐你进行以下的安装步骤
|
31 |
|
32 | > 传统的 webpack4.x 没有 Tree Shaking 的支持, 如果你想引入 `@v-charts2/sankey/vue2` 或者 `@v-charts2/sankey/vue3` 的话, 可能会报错
|
33 |
|
34 | ```javascript
|
35 | import Vue from 'vue'
|
36 | import VeSankey from '@v-charts2/sankey' // 兼容 vue2.x 和 vue3.x 的支持, 将会自动加载支持 vue2.x 的支持包或者支持 vue3.x 的支持包
|
37 | Vue.use(VeSankey)
|
38 | ```
|
39 |
|
40 | 当你当前的打包工具为 vite 或者 rollup 时, 推荐你进行以下的安装步骤
|
41 |
|
42 | - Vue 2.x
|
43 |
|
44 | ```javascript
|
45 | import Vue from 'vue'
|
46 | import VeSankey from '@v-charts2/sankey/vue2' // 更好的 Tree Shaking 推荐引入 vue2.x 的专属支持包
|
47 | import '@v-charts2/sankey/v-charts.css' // 需要手动引入样式
|
48 | Vue.use(VeSankey)
|
49 | ```
|
50 |
|
51 | - Vue 3.x
|
52 |
|
53 | ```javascript
|
54 | import { createApp } from 'vue'
|
55 | const app = createApp()
|
56 | import VeSankey from '@v-charts2/sankey/vue3' // 更好的 Tree Shaking 推荐引入 vue3.x 的专属支持包
|
57 | import '@v-charts2/sankey/v-charts.css' // 需要手动引入样式
|
58 | app.use(VeSankey)
|
59 | ```
|