Error with passing a prop from parent to child component

Josh90

So I am having an issue with passing down a prop from my parent view to another view, right now I am just testing using a simple variable but it doesn't seem to be picking it up... there are no errors or anything, it is just not displayed on my page.

Here is my parent code:

<template>
  <v-app>
    <Navbar v-bind:currency="currency"/>
    <v-content class="mx-5 my-5" v-bind:currency="currency">
      <router-view></router-view>
    </v-content>

  </v-app>
</template>

<script>
import Navbar from '@/components/Navbar'

export default {
  name: 'App',
  components: {
    Navbar
  },
  data() {
    return {
      currency: "$ test"
    }
  },
};
</script>

And here is the code snippets from my child element:

export default {
  name: "Home",
  props: ['currency']
}

And where I use the currency:

<div class="text-center green--text font-weight-bold headline">{{ currency }}</div>

Can anyone see anything I have done wrong there as to why this element is not being picked up?

Kind Regards, Josh

Reinier68

It should work fine, I don't see anything wrong with it: Here's a simple working reproduction. Check it with that to make sure there are no differences.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Error while passing prop from parent to child - type is invalid

Getting Child Component Prop from the Parent Component

Passing a prop to a child from parent with React and Gatsby

Passing prop from child to parent is null

Error while passing data from a child to parent component in reactjs

Passing Data From Child Component Into Parent Component

Passing data from Parent Component to Child Component

JavaScript React: Issues with passing prop from a function in a child component to a function in the parent

React - Error while rendering child component with prop passed from parent component

passing data from child to parent component in Vue

Passing state from parent component to child function

NativeScript - Passing content from Parent to Child component

Passing props from parent component to child components

Passing data from child to parent component in React

Passing the value from the child to parent component and then to the child component again

HTML error when Passing data from Parent component to Child Component in Angular

Passing data from service to parent then from parent to child component

React typescript passing function as prop and calling from child component

Using React Hooks, when I pass down a prop from parent to a child component, the prop in the child component is undefined

ReactJS - passing part of onClick function as a prop from parent component

ReactJS Passing data from child component, to parent, back to different child

Use parent prop on child component prop

React - Passing a value from child component to the parent component

Passing method from parent component to child component in vuejs

Passing data from child component to parent component in react native?

Passing props from parent component to child component on dialog box vue

React: Passing value from child component to parent component

React - Passing ref from dumb component(child) to smart component(parent)

passing a variable from child component to parent component in Next.js