From b851d0951a8eb09cf660d6438f2d1d57f5af1593 Mon Sep 17 00:00:00 2001 From: ldz <1262327911@qq.com> Date: Mon, 19 Oct 2020 20:29:10 +0800 Subject: [PATCH] update README --- README.md | 2 +- src/components/echart/bottom/bottomRightChart/index.vue | 2 -- src/utils/index.js | 2 +- src/utils/resizeMixins.js | 3 +-- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 14c4098..12fecf7 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ ### 封装组件渲染图表 -所有的 ECharts 图表都是基于 `common/echart/index.vue` 封装组件创建的,已经对数据和屏幕改动进行了监听,能够动态渲染图表数据和大小。在监听窗口小大的模块,使用了节流函数来节约浏览器性能。 +所有的 ECharts 图表都是基于 `common/echart/index.vue` 封装组件创建的,已经对数据和屏幕改动进行了监听,能够动态渲染图表数据和大小。在监听窗口小大的模块,使用了防抖函数来控制更新频率,节约浏览器性能。 项目配置了默认的 ECharts 图表样式,文件地址:`common/echart/theme.json`。 diff --git a/src/components/echart/bottom/bottomRightChart/index.vue b/src/components/echart/bottom/bottomRightChart/index.vue index 789fec8..d8cd47f 100644 --- a/src/components/echart/bottom/bottomRightChart/index.vue +++ b/src/components/echart/bottom/bottomRightChart/index.vue @@ -51,8 +51,6 @@ export default { for (let i = 0; i < 7; i++) { // 日期 let date = new Date(); - console.log(date.getMonth()); - console.log(date.getDate()); this.cdata.weekCategory.unshift([date.getMonth() + 1, date.getDate()-i].join("/")); // 折线图数据 diff --git a/src/utils/index.js b/src/utils/index.js index 14e554d..0452fb5 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,5 +1,5 @@ /** - * @param {Function} fn 函数 + * @param {Function} fn 防抖函数 * @param {Number} delay 延迟时间 */ export function debounce(fn, delay) { diff --git a/src/utils/resizeMixins.js b/src/utils/resizeMixins.js index cdefacf..a4d25bc 100644 --- a/src/utils/resizeMixins.js +++ b/src/utils/resizeMixins.js @@ -22,10 +22,9 @@ export default { window.removeEventListener('reisze', this[resizeChartMethod]); }, methods: { - // 通过 lodash 的防抖函数来控制 resize 的频率 + // 防抖函数来控制 resize 的频率 [resizeChartMethod]: debounce(function() { if (this.chart) { - console.log('修改'); this.chart.resize(); } }, 300),