weex-native-directive icon indicating copy to clipboard operation
weex-native-directive copied to clipboard

Parse object literal in binding attributes or styles

Open Hanks10100 opened this issue 7 years ago • 1 comments

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 }'
  }
}

Hanks10100 avatar Dec 18 '17 12:12 Hanks10100

We can use acorn to parse and transform the expression.

yyx990803 avatar Dec 19 '17 03:12 yyx990803