T
T
thorii2017-09-11 15:36:43
Node.js
thorii, 2017-09-11 15:36:43

How to render nuxt-link element in component's render function?

export default {
    props: {
      route: {
        type: Boolean,
        'default': false
      }
    },
    render (h) {
      return h(this.route ? 'nuxt-link' : 'a')
    }

  }

This code calls Cannot read property 'name' of undefined
UPD.
Changed to =>
return h(this.route ? 'nuxt-link' : 'a')
return h(this.route ? { name: 'nuxt-link' } : 'a')
render function or template not defined in component: nuxt-link

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question