Skip to content
Advertisement

How can i get boolean data from another component in vue js?

I have two Components.

In the second component, “date-detail-filter” I always keep track for boolean value, and want to access this data in my parent component.

Advertisement

Answer

do you know how to use $emit?

In your date-detail-filter component

you can add this to your method. this.$emit('your-event-name', 'your payload')

and in your main component.

<date-detail-filter @your-event-name="functionName()"/>

functionName(payload) {
   your logic here to hide the caret
}

$emit is used to pass data from child component to parent component via event.

Advertisement