Created
March 19, 2021 07:46
-
-
Save ordinz/16994990eced35b22966242eefc7cffa to your computer and use it in GitHub Desktop.
Extend Modal from "tailwindcss-stimulus-components"
This file contains hidden or 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 hidden or 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