Complete the code to pass a prop named title with value 'Hello' to the component.
<MyComponent :title=[1] />In Vue, props passed as strings should be enclosed in single or double quotes. Here, 'Hello' is correct.
Complete the code to emit an event named submit with payload data inside the component.
this.$emit([1], data);The event name must be a string, so it should be in quotes. Single quotes are common in Vue.
Fix the error in the test code to correctly mount the component with a prop count set to 5.
const wrapper = mount(MyComponent, { props: { count: [1] } });Props that are numbers should be passed as numbers, not strings.
Fill both blanks to test that the component emits update event with payload 42.
await wrapper.vm.$emit([1], [2]); expect(wrapper.emitted()).toHaveProperty('update');
The event name is 'update' and the payload is the number 42.
Fill all three blanks to create a test that mounts MyComponent with prop visible true, triggers close event, and asserts it was emitted.
const wrapper = mount(MyComponent, { props: { [1]: [2] } });
await wrapper.vm.$emit([3]);
expect(wrapper.emitted()).toHaveProperty('close');The prop name is visible set to true. The event emitted is 'close'.