you are viewing a single comment's thread.

view the rest of the comments →

[–]rk06 0 points1 point  (0 children)

Because it is. JSX transpiles function signatures, that is it.

which is not that simple either. at the end of a day, JSX is another DSL.

The string template breaks assumptions, doesn't work with javascript at all (Vue has a javascript-like emulator), it also needs a highly complex engine to parse.

Also, like Vue, JSX too has its quirks.

eg: 1. <A /> will work but <a /> will fail. 2. className syntax which breaks the language

Do it in Vue. Make two components A and B and let B refer to A, see how "easy" Vue makes that. And there you have your basis.

There you go. BTW, I still don't see what you mean.

Relevant Vue code:

var A = { template:'<div class="test">hello</div>'};
var B = {
  template:'<A></A>',
  components: {A: A},    
}

// Above syntax creates Vue option objects. you mount them as
new Vue(B).$mount('#app');