Skip to content

Commit 244b09e

Browse files
authored
Merge pull request #169 from barnett617/patch-1
fix: missing vue special method
2 parents d12844e + 3c6cdc3 commit 244b09e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/__tests__/vue-class-component/migrator-methods.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ describe('Methods Property Migration', () => {
1313
created() {
1414
console.log("OK");
1515
}
16+
beforeDestroy() {
17+
console.log("beforeDestroy triggerd");
18+
}
1619
}`,
1720
// Results
1821
`import { defineComponent } from "vue";
1922
2023
export default defineComponent({
2124
created() {
2225
console.log("OK");
26+
},
27+
beforeDestroy() {
28+
console.log("beforeDestroy triggerd");
2329
}
2430
})`,
2531
);

src/migrator/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const vueSpecialMethods = [
1616
'activated',
1717
'deactivated',
1818
'serverPrefetch',
19+
'beforeDestroy',
1920
'destroyed',
2021
]; // Vue methods that won't be included under methods: {...}, they go to the root.
2122

0 commit comments

Comments
 (0)