|
|
|
|
|
by dmitriid
2899 days ago
|
|
> The amount of special cases in Vue templating syntax is comparable to the special cases and gotchas of JSX This is patently not so. Vue has: - three different html-like attributes - three different scripting languages in templates (two Javascript-like, one Javascript, but only expressions) - one scripting language for controller/model which actually breaks JS assumptions (about what `this` is, for example) by magiacally hoisting some (but not all) properties of an object https://pbs.twimg.com/media/DbVEoKOX0AEEen6.jpg:large |
|
v-bind and v-on (and v-if) accept regular javascript, and it's not just expressions... you can use `active = true` to change a data value, for instance.
The only exception is v-for, as you mentioned, but it is close enough to ES6 for syntax to make sense, at least IMO.
This is splitting hairs a bit, isn't it? Apart from v-for, you can write pretty much anything you want in the other two. You mean the script part of components? Do you have any examples of that?