Skip to content

Commit 1576eb0

Browse files
committed
Merge branch 'dev' into next
2 parents e020b07 + 75a1c89 commit 1576eb0

File tree

7 files changed

+41
-45
lines changed

7 files changed

+41
-45
lines changed

dist/VueFinalModal.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/components/basic/VStopBeforeClose.vue

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,24 @@
66
content-class="modal-content"
77
@before-close="e => e.stop()"
88
>
9-
<template>
10-
<button class="modal__close" @click="showModal = false">
11-
<mdi-close></mdi-close>
9+
<button class="modal__close" @click="showModal = false">
10+
<mdi-close></mdi-close>
11+
</button>
12+
<span class="modal__title">Hello, vue-final-modal</span>
13+
<div class="modal__content">
14+
<p v-for="i in 5" :key="i">
15+
Vue Final Modal is a renderless, stackable, detachable and lightweight
16+
modal component.
17+
</p>
18+
</div>
19+
<div class="modal__action">
20+
<button class="vfm-btn" @click="showModal = false">
21+
confirm
1222
</button>
13-
<span class="modal__title">Hello, vue-final-modal</span>
14-
<div class="modal__content">
15-
<p v-for="i in 5" :key="i">
16-
Vue Final Modal is a renderless, stackable, detachable and
17-
lightweight modal component.
18-
</p>
19-
</div>
20-
<div class="modal__action">
21-
<button class="vfm-btn" @click="showModal = false">
22-
confirm
23-
</button>
24-
<button class="vfm-btn" @click="showModal = false">
25-
cancel
26-
</button>
27-
</div>
28-
</template>
23+
<button class="vfm-btn" @click="showModal = false">
24+
cancel
25+
</button>
26+
</div>
2927
</vue-final-modal>
3028
<button class="vfm-btn" @click="showModal = true">Open modal</button>
3129
</div>

example/src/components/basic/VStopBeforeOpen.vue

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,24 @@
66
content-class="modal-content"
77
@before-open="e => e.stop()"
88
>
9-
<template>
10-
<button class="modal__close" @click="showModal = false">
11-
<mdi-close></mdi-close>
9+
<button class="modal__close" @click="showModal = false">
10+
<mdi-close></mdi-close>
11+
</button>
12+
<span class="modal__title">Hello, vue-final-modal</span>
13+
<div class="modal__content">
14+
<p v-for="i in 5" :key="i">
15+
Vue Final Modal is a renderless, stackable, detachable and lightweight
16+
modal component.
17+
</p>
18+
</div>
19+
<div class="modal__action">
20+
<button class="vfm-btn" @click="showModal = false">
21+
confirm
1222
</button>
13-
<span class="modal__title">Hello, vue-final-modal</span>
14-
<div class="modal__content">
15-
<p v-for="i in 5" :key="i">
16-
Vue Final Modal is a renderless, stackable, detachable and
17-
lightweight modal component.
18-
</p>
19-
</div>
20-
<div class="modal__action">
21-
<button class="vfm-btn" @click="showModal = false">
22-
confirm
23-
</button>
24-
<button class="vfm-btn" @click="showModal = false">
25-
cancel
26-
</button>
27-
</div>
28-
</template>
23+
<button class="vfm-btn" @click="showModal = false">
24+
cancel
25+
</button>
26+
</div>
2927
</vue-final-modal>
3028
<button class="vfm-btn" @click="showModal = true">Open modal</button>
3129
</div>

lib/VueFinalModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ watch(
151151
}
152152
mounted()
153153
if (!value) {
154+
if (emitEvent('before-close', true)) {
155+
return
156+
}
154157
close()
155158
}
156159
}
@@ -238,9 +241,6 @@ function mounted() {
238241
}
239242
}
240243
function close() {
241-
if (emitEvent('before-close', true)) {
242-
return
243-
}
244244
if ($vfm.openedModals.length > 0) {
245245
// If there are still nested modals opened
246246
const $_vm = $vfm.openedModals[$vfm.openedModals.length - 1]

0 commit comments

Comments
 (0)