in VueJS by
What is the use of compile method?

1 Answer

0 votes
by
VueJS provides compile method which is used to compile a template string into a render function. This method is only available in the full build.

For example, you can compile template message:

var result = Vue.compile('<div><span>{{ msg }}</span></div>')

new Vue({
  data: {
    msg: 'Welcome to Vue world'
  },
  render: result.render,
  staticRenderFns: result.staticRenderFns
})
...