vue-props

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

不问归期 提交于 2020-02-03 10:20:50
问题 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 image_url from ItemsList to ItemImage , in order to change the image on right, after item on left is changed automatically on time intervals. Left side: component ItemsList.vue Right side: component ItemImage.vue Component Menu.vue has 2 child components: <template> <div> <!-- Two columns --> <div class=

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

故事扮演 提交于 2019-12-24 21:20:55
问题 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 which gets triggered when you click one of the orange buttons by the following code, <div v-for="(obtainedCardInfo, index) in obtainedCardsInfo"> <span v-if="cardBtnChosen && card.id == selectedCard && obtainedCardInfo.id == selectedCard"> <span class="cardInfo">DETAILED CARD INFO:</span> <div class=

Vue.js - access data property from within template without using props in vue file

安稳与你 提交于 2019-12-24 06:17:10
问题 In my Laravel + Vue.js SPA (Single Page Application), I am using BootstrapVue and VeeValidate. In EditProfile.vue file, I want to access the data property namely default_country_code from an attribute in the template namely default_country_code . I can achieve it by using props i.e: having a data attribute in Vue root instance and then using it in the template with the help of props in EditProfile.vue file. But I want to use it in the template without using any props . Because if I use props