Skip to content

Commit 285631f

Browse files
committed
fix: root undefined when using ssr:false and attach at same time
1 parent 58ea6c2 commit 285631f

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
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.

lib/VueFinalModal.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,17 @@ export default {
354354
355355
let target = getAttachElement()
356356
if (target || props.attach === false) {
357-
props.attach !== false && target.appendChild(root.value)
357+
if (props.attach !== false) {
358+
if (root.value) {
359+
target.appendChild(root.value)
360+
} else {
361+
visible.value = true
362+
nextTick(() => {
363+
mounted()
364+
})
365+
return
366+
}
367+
}
358368
359369
let index = props.api.openedModals.findIndex(vm => vm.uid === uid)
360370

0 commit comments

Comments
 (0)