[Vuejs]-Using a render function inside a computed property with vuetify

0πŸ‘

βœ…

The render function cannot be used with the template tag, the template tag will "override" the render function.

Furthermore, the render function cannot be inside the method keyword but directly in the first level of the script.

In your case your code should be:

<div id="app"></div>

new Vue({
    el: '#app',
    // ...
    render(createElement){
      const stepperStep = createElement('v-stepper-step', 'Some step')
      const divideAndConquer = createElement('v-divider')
      return createElement('v-stepper', [
        stepperStep, divideAndConquer
      ])
    }
    // ...
  })

Inside your render function your must return some JSX that will be rendered inside your app

In the code above, the element v-stepper will be render and added to the #app element

cf: https://v2.vuejs.org/v2/guide/render-function.html

Leave a comment