Loading...
Loading...
Error
Oops! Something went wrong
5. Communication Between Vue Components with Custom Events
Speed
Speed
Quality
Quality
Captions
Captions
media loading
Play
Pause
10
Seek backward
Rewind 10s
Play
Pause
Play
Play
Pause
Pause
20
Seek forward
Forward 20s
Mute
Unmute
Volume High
Volume Low
Volume Low
Mute
Mute
Unmute
0:00
0:00
Start casting
Stop casting
Chapters
Chapters
Communicating Data Between Nested Components
00:00
Passing Data from Child to Parent
00:19
Implementing Selection in CoffeePlan Component
00:29
Adding Local Selected State to CoffeePlan
00:40
Conditionally Applying Active Plan Class
01:02
Toggling Selection on Click
01:35
The Problem: Multiple Selections
02:08
Requirement: Single Selection in Plan Picker
02:22
Communicating Up with Custom Events
02:41
Defining Custom Events with defineEmits
02:47
Emitting a Custom Event ('hi there')
03:04
Refactoring Selection Logic into a Function
03:10
Accessing Emit Function from defineEmits
03:37
Using Vue DevTools for Component Events
04:03
Defining a Meaningful Custom Event ('selected')
04:54
Adding a Payload to Custom Events
05:12
Listening for Custom Events in the Parent (V-on / @)
05:45
Handling the Event and Accessing Payload ($event)
06:14
Storing Selected Coffee Plan in Parent State
06:59
Displaying Selected Plan at Parent Level
07:22
Summary of Custom Event Implementation
07:51
Shortening Event Handler with Automatic Payload Passing
08:25
Connecting Parent's Selected State to Child Styling
08:46
Passing Selection as a Boolean Prop to Child
09:17
Updating Child Component to Use Prop for Selection
09:38
Removing Local Selected State in Child
09:51
Verification of Single Selection Functionality
10:22
Alternative: Using Native Event Listener on Child
10:40
Issue with Native Event Listener Payload
11:27
Correcting Native Event Listener Implementation
11:47
When to Use Custom Events vs. Native Event Listeners
12:14
Enable captions
Disable captions
Enable Captions
Enable captions
Disable Captions
Disable captions
Settings
Settings
Settings
Enter fullscreen mode
Exit fullscreen mode
Fullscreen
Enter fullscreen
Exit Fullscreen
Exit fullscreen