vue-bulma / modal

Modal component for Vue Bulma
MIT License
49 stars 28 forks source link

Need documentation #3

Closed loranger closed 6 years ago

loranger commented 8 years ago

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

fundon commented 8 years ago

Thank you for your suggestion.

Yes, we need the documentation.

marekkaczkowski commented 7 years ago

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:

luventa commented 7 years ago

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()
    }
marekkaczkowski commented 7 years ago

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]?

luventa commented 7 years ago

I cannot find a better way... Because the modal creates a new element which cannot put v-on to the element.

Juckky00 commented 6 years ago

how to close modal when click cancel button ?