Skip to content

前言

在 HTML 中定义一个 <div> 节点,并且通过 CSS 使得该节点具有宽度和高度。初始化图表的时候,传入该节点,图表的大小默认即为该节点的大小

创建一个 Vue 应用

环境:Node16 和 Node18 (nvm 来管理)

开发工具: VSCode

代码: 直接从本人的 Github 上拉取

INFO

Vue3 模板

shell
git clone -b test https://github.com/luckyNwa6/luckyVue3Template.git

Vue2 模板

shell
git clone -b test https://github.com/luckyNwa6/luckyVue2Template.git

安装

vue2模板

shell
yarn   安装全部依赖
yarn remove  echarts

vue3模板

shell
pnpm i
pnpm uninstall echarts

可选版本

shell
npm install echarts --save
yarn add echarts
pnpm install echarts@4.9.0 --save