Skip to content

Commit

Permalink
lint: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dntzhang committed May 18, 2023
1 parent 0d90f29 commit c1239a7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/omi/src/we-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c1239a7

Please sign in to comment.