Your IP : 216.73.216.79


Current Path : /var/www/html/bookstack/resources/js/components/
Upload File :
Current File : /var/www/html/bookstack/resources/js/components/event-emit-select.js

import {onSelect} from "../services/dom";

/**
 * EventEmitSelect
 * Component will simply emit an event when selected.
 *
 * Has one required option: "name".
 * A name of "hello" will emit a component DOM event of
 * "event-emit-select-name"
 *
 * All options will be set as the "detail" of the event with
 * their values included.
 *
 * @extends {Component}
 */
class EventEmitSelect {
    setup() {
        this.container = this.$el;
        this.name = this.$opts.name;


        onSelect(this.$el, () => {
            this.$emit(this.name, this.$opts);
        });
    }

}

export default EventEmitSelect;