Skip to content

Commit d87727e

Browse files
author
Joel Denning
authored
Fix parcel unmounting in vue 3. Resolves #78. (#79)
1 parent 6253020 commit d87727e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"scripts": {
1818
"prepublishOnly": "yarn build",
1919
"build": "rimraf dist && rollup -c",
20+
"build:watch": "rollup -cw",
2021
"test": "concurrently -n w: 'yarn:test:*'",
2122
"test:jest": "cross-env BABEL_ENV=test jest",
2223
"test:types": "tsd",

src/parcel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import * as Vue from "vue";
22

3+
const lessThanVue3 = !Vue.version || /^[012]\..+/.test(Vue.version);
4+
35
export default {
46
props: {
57
config: [Object, Promise],
@@ -96,7 +98,7 @@ export default {
9698
this.addThingToDo("mount", this.singleSpaMount);
9799
}
98100
},
99-
destroyed() {
101+
[lessThanVue3 ? "destroyed" : "unmounted"]() {
100102
this.addThingToDo("unmount", this.singleSpaUnmount);
101103
},
102104
watch: {

0 commit comments

Comments
 (0)