Closed loranger closed 6 years ago
Thank you for your suggestion.
Yes, we need the documentation.
Hey,
Can you briefly describe how to close CardModal with cancel button (IMO it should call close by default)? For now button only emits cancel event which has no corresponding method.
Thank you for beautiful component :1st_place_medal:
hi @marekkaczkowski , $on
will solve your issue.
Here is an example, I made change in vue-admin Modal demo
openModalCard () {
const cardModal = this.cardModal || (this.cardModal = openCardModal({
title: 'Modal title',
url: this.$store.state.pkg.homepage
}))
cardModal.$children[0].$on('cancel', () => {
console.log('do task')
})
cardModal.$children[0].active()
}
Hey @luventa thanks for you reply. I already figured out it in a same way :wink:
Just wondering, is there a better way to listen to events on modal component than .$children[0]
?
I cannot find a better way... Because the modal creates a new element which cannot put v-on
to the element.
how to close modal when click cancel button ?
Hello,
Thank you for this component, but that would be really useful to add a tiny documentation.
I've just spend 2 hours trying to make this component works. I've created a custom component, and imported vue-bulma-modal, then instantiate this component with Vue but I still can't figure out how I can trigger any modal methods (which are ?) from my webpage. Can I achieve this from my component ? Am I supposed to use Vuex ?
Please consider a basic documentation.
Thanks