advanced syntaxes (VAR{}): avoid storing default value as string if it can be parsed as a javascript primitive (boolean, number, etc)
This commit is contained in:
parent
e98f270690
commit
15b52a5d25
2 changed files with 7 additions and 0 deletions
|
|
@ -638,6 +638,12 @@ class Widget extends EventEmitter {
|
|||
return typeof variables[m] === 'string' ? variables[m] : JSON.stringify(variables[m])
|
||||
}))
|
||||
|
||||
if (typeof value === 'string' && isJSON(value)) {
|
||||
try {
|
||||
value = JSON.parseFlex(value)
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
if (!this.variables[name]) {
|
||||
|
||||
this.variables[name] = {default: value, value: value, propNames: [propName]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue