-
-
Save goliatone/aabf2c00b9ca58f7287dd4d5caa6e08f to your computer and use it in GitHub Desktop.
Extend Modal from "tailwindcss-stimulus-components"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Modal} from "tailwindcss-stimulus-components" | |
export default class extends Modal { | |
connect(){ | |
this.element[this.identifier] = this | |
this.toggleClass = 'hidden' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Controller } from "stimulus" | |
export default class extends Controller { | |
someFunc(event) { | |
//opening the modal from outside | |
document.querySelector('#subscribe-modal').modal.open({ target: event.currentTarget }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment