0👍
Try this out:
Child Component:
<template>
<div>
<button @click="openPopup(true)">Open</button>
</div>
</template>
<script>
// ...
export default {
// ...
methods: {
openPopup(flag) {
this.$emit("openPopupInParent", flag);
}
}
};
</script>
Parent Component:
<template>
<div>
<popup v-show="isShown" @openPopupInParent="showPopup"></popup>
</div>
</template>
<script>
// ...
export default {
// ...
methods: {
showPopup(flag) {
this.isShown = flag
}
}
};
</script>
- [Vuejs]-How to merge two column which have same value into one column given they are sharing the similar product id?
- [Vuejs]-Need Help in Router Guard Navigation in Vuejs
Source:stackexchange.com