forked from quasarframework/quasar
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(portals): check if showing portal before delayed hiding; fix page…
- Loading branch information
Showing
5 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<template> | ||
<div class="q-layout-padding"> | ||
<div class="q-pa-md q-gutter-sm"> | ||
<q-btn label="Open dialog" color="primary" @click="openDialog"></q-btn> | ||
<q-btn label="Open menu" color="primary" @click="openMenu"></q-btn> | ||
|
||
<q-dialog v-model="dialogModel"> | ||
<q-card> | ||
<q-card-section> | ||
<div class="text-h6">Dialog</div> | ||
</q-card-section> | ||
|
||
<q-card-section class="q-pt-none"> | ||
Click the button below to relaunch this dialog | ||
</q-card-section> | ||
|
||
<q-card-actions align="right" class="text-primary"> | ||
<q-btn flat label="Relaunch" @click="relaunchDialog"></q-btn> | ||
</q-card-actions> | ||
</q-card> | ||
</q-dialog> | ||
|
||
<div> | ||
<q-menu v-model="menuModel"> | ||
<q-card> | ||
<q-card-section> | ||
<div class="text-h6">Menu</div> | ||
</q-card-section> | ||
|
||
<q-card-section class="q-pt-none"> | ||
Click the button below to relaunch this menu | ||
</q-card-section> | ||
|
||
<q-card-actions align="right" class="text-primary"> | ||
<q-btn flat label="Relaunch" @click="relaunchMenu"></q-btn> | ||
</q-card-actions> | ||
</q-card> | ||
</q-menu> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data () { | ||
return { | ||
dialogModel: false, | ||
menuModel: false | ||
} | ||
}, | ||
methods: { | ||
openDialog () { | ||
this.dialogModel = true | ||
}, | ||
closeDialog () { | ||
this.dialogModel = false | ||
}, | ||
relaunchDialog () { | ||
this.closeDialog() | ||
if (this.delayDialog < 0) { | ||
this.delayDialog = 0 | ||
console.log('nextTick dialog') | ||
this.$nextTick(() => { | ||
this.openDialog() | ||
}) | ||
} | ||
else { | ||
console.log('setTimeout dialog', this.delayDialog) | ||
setTimeout(() => { | ||
this.openDialog() | ||
}, this.delayDialog++) | ||
} | ||
}, | ||
openMenu () { | ||
this.menuModel = true | ||
}, | ||
closeMenu () { | ||
this.menuModel = false | ||
}, | ||
relaunchMenu () { | ||
this.closeMenu() | ||
if (this.delayMenu < 0) { | ||
this.delayMenu = 0 | ||
console.log('nextTick menu') | ||
this.$nextTick(() => { | ||
this.openMenu() | ||
}) | ||
} | ||
else { | ||
console.log('setTimeout menu', this.delayMenu) | ||
setTimeout(() => { | ||
this.openMenu() | ||
}, this.delayMenu++) | ||
} | ||
} | ||
}, | ||
created () { | ||
this.delayDialog = -1 | ||
this.delayMenu = -1 | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters