[Vuejs]-[Vue warn]: Error in render: "TypeError: Cannot read property 'props' of undefined" (found in <Root>)

0👍

testData.js does not correctly define a Vue mixin. To define a method mixin to be exported, you’d export an object with a methods prop that contains your desired method (much like declaring a new component options with object syntax):

// ./js/testData.js
export default {
  methods: {
    populateTestData() {
      //...
    }
  }
}

Then your component would use the mixin like this:

import myMixin from './js/testData'

export default {
  mixins: [myMixin],
}

Leave a comment