From 095b6ca0f28ac2b3bef7d1701f1b2f57e15845cc Mon Sep 17 00:00:00 2001 From: fayeah <411596701@qq.com> Date: Fri, 11 Sep 2020 22:52:22 +0800 Subject: [PATCH] Update index.js replace var with const --- pages/treemap/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/treemap/index.js b/pages/treemap/index.js index ad626a6..7faa400 100644 --- a/pages/treemap/index.js +++ b/pages/treemap/index.js @@ -9,15 +9,15 @@ function initChart(canvas, width, height, dpr) { devicePixelRatio: dpr // new }); canvas.setChart(chart); - var data = []; + const data = []; - for (var i = 0; i <= 360; i++) { - var t = i / 180 * Math.PI; - var r = Math.sin(2 * t) * Math.cos(2 * t); + for (const i = 0; i <= 360; i++) { + const t = i / 180 * Math.PI; + const r = Math.sin(2 * t) * Math.cos(2 * t); data.push([r, i]); } - var option = { + const option = { title: { text: '2014年中国耕地质量', left: 'center', @@ -180,4 +180,4 @@ Page({ }, onReady() { } -}); \ No newline at end of file +});