import { CocoComponent } from "@js/coco.js"; import { getComponent } from "@helpers/alpine"; export default CocoComponent("buttonDropdown", (data = {}) => { return { dropdown: null, button: null, init() { this.$nextTick(() => { this.button = getComponent(this.$el.querySelector(".coco-button")); }); }, hideDropdown() { if (this.dropdown) { this.dropdown.hide(); } }, showDropdown() { if (this.dropdown) { this.dropdown.show(); } }, }; });