Closed aninfeel closed 6 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.
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 )-:
@aninfeel @Remo Thank you for your feedbacks.
Maybe it needs an option for that.
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.
@Remo Thank you for your suggestion.
Let me see.
@fundon你好, 我在使用中也遇到了上面跟楼上几位相同的问题,大致看了下baseModel和cardModel的源码。发现baseModel中用变量show代替了外部传进来的visible,也就切断了与外部的联系。
data () {
return {
show: this.visible
}
}
个人建议还是可以把窗口的显示和隐藏交给用户去控制。 还有一个问题,其实我想自定义ok,cancel,close三个按钮的事件,希望能加入自定义事件的event。
Please try v1.0.1.
Modal is still not reusable. Once it's deactivated, it cannot be activated. Why not call cancel
instead of deactivate
?
What about a CardModal?
@kalinchuk You can try to follow that way.
It can't be re-showed again after :visibility property has been set to "false".