Closing drawer panel and then open modal?
-
In this moment i using that flow:
openModal () { this.$refs.layout.toggleRight() setTimeout(() => this.$refs.objModal.openModal(), 1) }
Is any “easier” way?
-
openModal () { this.$refs.layout.toggleRight() this.$nextTick(() => { this.$refs.objModal.openModal() }) }
…is probably cleaner, and I really can’t see any simpler way to express those intentions.
-
Hi,
Thanks! -
uhh, working only for the first time… Next cycle only drawer panel closing, but modal does not show…(setTimeout forking)
-
yup… sorry, there’s a mistake in the code
try this insteadopenModal () { this.$refs.layout.toggleRight() this.$refs.objModal.open() }
and if you really need nextTick (for questions of sizing, events, tag presence or whatever), just put it back in.
-
This post is deleted! -
btw if your panel is closed, this will open it, and then open the modal.
if that’s not what you want, consider using hideRight() instead of toggleRight() -
Also note that toggleRight() and hideRight() accept a callback that is called after drawer panel gets closed. You should use that instead of using setTimeout() or nextTick()
-
@rstoenescu thanks - callback working fine