0 votes
in VueJS by

What is the purpose of vuejs compiler?

1 Answer

0 votes
by

The compiler is is responsible for compiling template strings into JavaScript render functions.

For example, the below code snippet shows the difference of templates which need compiler and not,

// this requires the compiler

new Vue({

  template: '<div>{{ message }}</div>'

})

// this does not

new Vue({

  render (h) {

    return h('div', this.message)

  }

})

Related questions

0 votes
asked Feb 4, 2020 in VueJS by rajeshsharma
0 votes
asked Sep 12, 2023 in VueJS by GeorgeBell
...