fix: support Angular-style attributes and object/array literals in compiled templates
Lexer changes:
- Support quoted attribute names: '(click)'='play()' or "(click)"="play()"
- Support parenthesized attribute names: (click)='play()' (Angular/Vue event bindings)
Build templates changes:
- Object literals for style attribute converted to CSS: {color: 'red'} -> color:red;
- Object literals for other attributes: extract values as space-separated
- Array literals converted to space-separated: ['foo', 'bar'] -> foo bar
This commit is contained in:
@@ -19,6 +19,14 @@ block content
|
||||
"data": true
|
||||
}
|
||||
`)
|
||||
|
||||
br
|
||||
div(class='div-class', (click)='play()') one
|
||||
div(class='div-class' '(click)'='play()') two
|
||||
a(style={color: 'red', background: 'green'}) sdfsdfs
|
||||
a.button btn
|
||||
br
|
||||
|
||||
form(method="post")
|
||||
+input_text("firstName", "First Name", "first name")
|
||||
br
|
||||
|
||||
Reference in New Issue
Block a user