vue-bulma / modal

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

It seems they are one time modal? #4

Closed aninfeel closed 6 years ago

aninfeel commented 7 years ago

It can't be re-showed again after :visibility property has been set to "false".

Remo commented 7 years ago

I think it can't even be shown if visible is set to false by default. I'm looking for a way to show/hide a modal which is defined in the table. The example only creates them dynamically.

Remo commented 7 years ago

Okay, I had to set an ref in order to dynamically open it:

<card-modal ref="modal" transition="zoom">
  <div class="content has-text-centered">
    test
  </div>
</card-modal>  

and then this

this.$refs.modal.active()

and now I've got the same problem, it only opens once )-:

fundon commented 7 years ago

@aninfeel @Remo Thank you for your feedbacks.

Maybe it needs an option for that.

Remo commented 7 years ago

Not sure why that would be an option, a modal should always be able to open and close many times. I don't see a case where that would hurt. I'd recommend to just change the default behaviour, I'm sure lots of people will run into the same problem otherwise.

fundon commented 7 years ago

@Remo Thank you for your suggestion.

Let me see.

zsrl commented 7 years ago

@fundon你好, 我在使用中也遇到了上面跟楼上几位相同的问题,大致看了下baseModel和cardModel的源码。发现baseModel中用变量show代替了外部传进来的visible,也就切断了与外部的联系。

data () {
    return {
      show: this.visible
    }
  }

个人建议还是可以把窗口的显示和隐藏交给用户去控制。 还有一个问题,其实我想自定义ok,cancel,close三个按钮的事件,希望能加入自定义事件的event。

fundon commented 7 years ago

Please try v1.0.1.

kalinchuk commented 7 years ago

Modal is still not reusable. Once it's deactivated, it cannot be activated. Why not call cancel instead of deactivate?

fundon commented 7 years ago

@kalinchuk See https://github.com/vue-bulma/vue-admin/blob/master/client/views/components/Modal.vue#L25.

kalinchuk commented 7 years ago

What about a CardModal?

fundon commented 7 years ago

@kalinchuk You can try to follow that way.