FrontendDeveloper.in

Vue.js question 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
})
Back to all Vue.js questions
Get LinkedIn Premium at Rs 399