weex-native-directive
weex-native-directive copied to clipboard
Parse object literal in binding attributes or styles
Source:
<div :style="{ fontSize: 15, color: item.color }"></div>
Should be compiled to:
{
style: {
fontSize: 15,
color: { '@binding': 'item.color' }
}
}
Current is:
{
style: {
'@binding': '{ fontSize: 15, color: item.color }'
}
}
We can use acorn to parse and transform the expression.