1👍
✅
Electron is just a runtime for your web app.
Take a look at Vue.js’s event model.
https://v2.vuejs.org/v2/guide/events.html
https://v2.vuejs.org/v2/guide/components-custom-events.html
Also, check out component guide https://ru.vuejs.org/v2/guide/components.html
In your case
<el-button></el-button>
is just a class added for the purpose of styling, not a parent component.
It is not a parent component it is a child component of <BookmarkMenu>
component. And it may contain absolutely anything inside.
And this.$emit('add-bookmark');
method triggers an event listener (if any) of a component which would have <BookmarkMenu>
as a child.
For example <BookmarkMenu @add-bookmark="someHandlerInAComponentContainingBookmarkMenu"/>
Source:stackexchange.com