From c1239a7e1002c4d1558ea9abb03184ac5e835a6f Mon Sep 17 00:00:00 2001 From: dntzhang Date: Thu, 18 May 2023 08:49:51 +0800 Subject: [PATCH] lint: lint fix --- packages/omi/src/we-element.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/omi/src/we-element.js b/packages/omi/src/we-element.js index 69b9fd1053..4014456bb6 100644 --- a/packages/omi/src/we-element.js +++ b/packages/omi/src/we-element.js @@ -246,11 +246,13 @@ export default class WeElement extends HTMLElement { if (val[0] === ':') { ele.props[key] = getValByPath(val.substr(1), Omi.$) } else { - try { - ele.props[key] = JSON.parse(val) - } catch(e) { - console.warn(`The ${key} object prop does not comply with the JSON specification, the incorrect string is [${val}].`) - } + try { + ele.props[key] = JSON.parse(val) + } catch (e) { + console.warn( + `The ${key} object prop does not comply with the JSON specification, the incorrect string is [${val}].` + ) + } } break }