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 }