FrontendDeveloper.in

Vue.js Track Detail

What is the use of compile method?

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
})