Riot compiler behavior on compiling method
Closed this issue · 2 comments
vojtabiberle commented
-
Describe your issue:
When I place{
opening bracket of method on new line in<script>
tag, Riot compiler don't build my method correctly. -
Can you reproduce the issue?
<my-tag>
<h1>{ message }</h1>
<button onclick={ handleClick }>Button 1</button>
<button onclick={ handleClickBad }>Button 2</button>
<script>
this.message = 'hello there'
handleClick(e) {
this.message = 'Click';
}
handleClickBad(e)
{
this.message = 'Click bad';
}
</script>
</my-tag>
becomes this
riot.tag('my-tag', '<h1>{ message }</h1><button onclick={ handleClick }>Button 1</button><button onclick={ handleClickBad }>Button 2</button>', function(opts){
this.message = 'hello there'
this.handleClick = function(e) {
this.message = 'Click';
}.bind(this);
handleClickBad(e)
{
this.message = 'Click bad';
}
}));
-
On which browser/OS does the issue appear?
Ubuntu 16.04 -
Which version of Riot does it affect?
Riot 2.6.7 compiled with grunt-riot -
How would you tag this issue?
- Question
- Bug
- Discussion
- Feature request
- Tip
- Enhancement
- Performance
Moved from riot/riot/issues/2065
GianlucaGuarini commented
This is not a riot-compiler issue https://runkit.com/gianlucaguarini/riot-compiler-rendering-test
gruint-riot uses an old riot release I recommend to open the issue directly on grunt-riot or just to use the official riot compiler/cli
vojtabiberle commented
Thanks for response