基于uni-app ts, 封装echarts库,适配H5端微信小程序端,其它端未测试,支持按需引入,支持导出为图片。
npm install echarts lodash -S
<script setup lang="ts">
import { ref } from 'vue'
<!-- 按需引入chart -->
import { PieChart } from 'echarts/charts'
<!-- 引入组件 -->
import comEcharts from '[XXXXX]/components/com-echarts/com-echarts.vue'
...
const chartsRef = ref()
const refresh = () => {
chartsRef.value?.reStore()
}
const saveImg = () => {
chartsRef.value?.saveImage()
}
<script setup lang="ts">
<template>
<!-- 页面使用 -->
<com-echarts ref="echartsRef" height="850rpx" :chartList="[PieChart]" :options="options"></com-echarts>
...
<template>
** props **
** 暴露的组件实例方法 **
![]() |
readme | 1 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/Sansnn-uQRCode/LICENSE | 11 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/Sansnn-uQRCode/README | 20 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/Sansnn-uQRCode/changelog | 1,023 b | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/qiun-data-charts/changelog | 30 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/qiun-data-charts/js_sdk/u-charts/readme | 532 b | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/qiun-data-charts/license | 11 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/qiun-data-charts/readme | 5 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/uview-ui/README | 3 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/uview-ui/changelog | 18 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/yt-dateTimePicker/changelog | 2 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |
![]() |
uni_modules/yt-dateTimePicker/readme | 3 KB | 查看 | 编辑 | 原始文档 | blame | 历史 |