Callback after dialog transition has finished

回眸只為那壹抹淺笑 提交于 2020-01-05 06:29:06

问题


Vuetify has some nice built-in transitions. But how can I call a method when the default dialog scale animation has finished?

https://codepen.io/anon/pen/qKNNLw

<v-dialog v-model="dialog" persistent max-width="200">
  <v-btn slot="activator">Open</v-btn>
  <v-card>
    <v-card-text>Thank you!</v-card-text>
    <v-card-actions>
      <v-spacer></v-spacer>
      <v-btn flat @click.native="dialog = false">Close</v-btn>
    </v-card-actions>
  </v-card>
</v-dialog>

Vuejs describes some Javascript callbacks here: https://vuejs.org/v2/guide/transitions.html#JavaScript-Hooks Is it possible to use them somehow?

My first idea was to set the dialog transition attribute to false and wrap it with a custom transition but this does not seem to work (disabling transition works but adding my own did not), maybe due to the underlying structure generated by Vuetify.

Background: I render a Google map inside the dialog that needs to resize after reaching full size.


回答1:


This issue is being treated in v1.2.x milestone of Vuetify : Heres the issue

You may consider recreating the modal wrapping it with the proper vuejs hooks as well.



来源:https://stackoverflow.com/questions/50710212/callback-after-dialog-transition-has-finished

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!