1 import {onSelect} from '../services/dom.ts';
2 import {Component} from './component';
6 * Component will simply emit an event when selected.
8 * Has one required option: "name".
9 * A name of "hello" will emit a component DOM event of
10 * "event-emit-select-name"
12 * All options will be set as the "detail" of the event with
13 * their values included.
15 export class EventEmitSelect extends Component {
18 this.container = this.$el;
19 this.name = this.$opts.name;
21 onSelect(this.$el, () => {
22 this.$emit(this.name, this.$opts);