From 2ea0f80a2d26dfbe620afc25221b97ffccb4f62e Mon Sep 17 00:00:00 2001 From: WangXinhai <18907191365@189.cn> Date: Sun, 1 Apr 2018 14:35:33 +0800 Subject: [PATCH] let - const --- src/components/ThemePicker/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ThemePicker/index.vue b/src/components/ThemePicker/index.vue index 052f6319..25292e4a 100644 --- a/src/components/ThemePicker/index.vue +++ b/src/components/ThemePicker/index.vue @@ -66,11 +66,11 @@ export default { methods: { updateStyle(style, oldCluster, newCluster) { - let colorOverrides = [] // only capture color overides + const colorOverrides = [] // only capture color overides oldCluster.forEach((color, index) => { - let value = newCluster[index] - let repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi') - let nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color' + const value = newCluster[index] + const repl = new RegExp(`(^|})([^{]+{[^{}]+)${color}\\b([^}]*)(?=})`, 'gi') + const nestRepl = new RegExp(color, 'ig') // for greed matching before the 'color' let v while ((v = repl.exec(style))) { colorOverrides.push(v[2].replace(nestRepl, value) + value + v[3] + '}') // '}' not captured in the regexp repl to reserve it as locator-boundary