Skip to main content

Questions tagged [vue-props]

For questions specific to the usage of the "props" property within the Vue.js framework. When using this tag also include the more generic [vue.js] tag.

vue-props
13 votes
2 answers
18k views

How could I watch a prop in the composition api?

How can I call a function when a prop is updated? parent container: <div> <Maintable :type="typeRef" :country="countryRef" /> </div> child container: ...
Posoroko's user avatar
  • 261
6 votes
2 answers
19k views

Passing props through a router-link

I'm new with Vue 3 router things, so really need help with it. I'm trying to pass prop through the router link. So, I have a component Post, where a prop post is an Object. Post.vue export default ...
kadeikin's user avatar
1 vote
1 answer
496 views

Transfer variables between Vue components

I’ve just started to learn Vue.js and need help. I have two components, the first one is not a parent for the second. I need to transfer a variable from one component to another. I’ve tried to use “...
Alex Dalen's user avatar
1 vote
2 answers
5k views

Vue-router4 - Passing object with <router-link :to> won't pass dynamic data

I went through this [email protected] object params which is somewhat related. There is a mention of this https://github.com/vuejs/vue-router-next/issues/494 in that thread, but I am still confused. I ...
NikOs's user avatar
  • 52
0 votes
2 answers
3k views

Vue JS Pass Data From Parent To Child Of Child Of Child

In Vue.js, how to correctly pass data from parent component to a chain of multi level child components?
Naourass Derouichi's user avatar
18 votes
3 answers
15k views

How to set types to vue slot props Typescript

I'm trying to set types on my slot props to handle in a table component as you can see in the image I also have been trying with #body={item: UserItem}, but it is only rename the parametter. #body={&...
Mauricio Loya's user avatar
8 votes
3 answers
11k views

Vue.js 3 declare a props with Array of Class

I try to define my component props where type is Array But it not working... import { Person } from '...' export default defineComponent({ props: { people: Array<Person> } }) ...
Max's user avatar
  • 4,789
8 votes
3 answers
12k views

Vue JS Non prop attributes and Disabling Attribute Inheritance

I have read the docs more than 5 times and I still can't understand what is Disabling Attribute Inheritance is used for and I don't understand the example given. I understand how props works, it is ...
desh's user avatar
  • 681
3 votes
2 answers
906 views

How to pass value from one child component to another in VueJS?

Full source code: https://github.com/tenzan/menu-ui-tw Demo: https://flamboyant-euclid-6fcb57.netlify.com/ Goal: ItemsList and ItemImage are child components to Menu.vue. I need to pass the ...
Askar's user avatar
  • 5,814
3 votes
2 answers
679 views

Other ways of showing prop-based conditonal text in Vue?

I have a component that renders text based on the users membership status and I want to change the interpolated text based on that prop value. Is there a more efficient way of showing different text ...
LovelyAndy's user avatar
2 votes
1 answer
972 views

Vue.js - How to pass down props to grandchildren

I have the following App structure RegistrationView (holds the data logic like get, post) - RegistrationForm (holds the form) -- Registration Radio Component (radio buttons rendered on delivered ...
deroccha's user avatar
  • 1,173
2 votes
2 answers
1k views

in vue 3.3 alpha 4 props destructure

I am trying vue 3.3.0 alpha-4 new feature but there is one problem. after destructure of props, normally it should keep their reactivity. but only field keep it. const { field, dialog, } = ...
yvl's user avatar
  • 650
2 votes
1 answer
6k views

Vue prop not updating properly in a child component

I've got a child component that receives a prop from the parent component. I've added an event to update the prop in the parent component when a button is clicked. But the child component does not ...
Chris's user avatar
  • 4,436
1 vote
1 answer
7k views

Passing an entire object via props not working in Vue.js while passing a single member works

I'm currently working on some practice code where you can fetch some detailed card data by clicking one of the displayed buttons. I implemented the "show the detailed card info" function ...
Sean2014's user avatar
  • 531
1 vote
1 answer
360 views

Props not being saved to a local state in vue components

(follow-up). In https://codesandbox.io/s/sjm0x props are intended to be saved to a local object (for later use) and rendered from there. It should look/behave like: https://codesandbox.io/s/v9pp6 (&...
Sebi's user avatar
  • 4,452

15 30 50 per page