Answer the question
In order to leave comments, you need to log in
vue. Weird behavior when passing props to a component. Why error?
I pass the parameters to the child component, which also came to this component through Props (the connectors object is in Props ):
<template>
<div>
<connector :index="'amazon'" :url="connectors['amazon']"></connector>
</div>
</template>
Error in render: "TypeError: Cannot read property 'amazon' of undefined"
TypeError: Cannot read property 'amazon' of undefined
Answer the question
In order to leave comments, you need to log in
Do you have an amazon variable or function in data or computed that returns something?
You pass a variable called amazon to props, if you remove v-bind from index, then amazon will become a string and will be passed inside the component.
Before getting a value from an object property, you can check the object itself for existence::url="connectors && connectors['amazon']"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question