Skip to content

Commit

Permalink
fix: root undefined when using ssr:false and attach at same time
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterliu1003 committed Oct 3, 2021
1 parent 58ea6c2 commit 285631f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/VueFinalModal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/VueFinalModal.umd.js.map

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion lib/VueFinalModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,17 @@ export default {
let target = getAttachElement()
if (target || props.attach === false) {
props.attach !== false && target.appendChild(root.value)
if (props.attach !== false) {
if (root.value) {
target.appendChild(root.value)
} else {
visible.value = true
nextTick(() => {
mounted()
})
return
}
}
let index = props.api.openedModals.findIndex(vm => vm.uid === uid)
Expand Down

0 comments on commit 285631f

Please sign in to comment.