diff --git a/src/__tests__/vue-class-component/migrator-methods.test.ts b/src/__tests__/vue-class-component/migrator-methods.test.ts index 24d225e..83c2c5a 100644 --- a/src/__tests__/vue-class-component/migrator-methods.test.ts +++ b/src/__tests__/vue-class-component/migrator-methods.test.ts @@ -13,6 +13,9 @@ describe('Methods Property Migration', () => { created() { console.log("OK"); } + beforeDestroy() { + console.log("beforeDestroy triggerd"); + } }`, // Results `import { defineComponent } from "vue"; @@ -20,6 +23,9 @@ describe('Methods Property Migration', () => { export default defineComponent({ created() { console.log("OK"); + }, + beforeDestroy() { + console.log("beforeDestroy triggerd"); } })`, ); diff --git a/src/migrator/config.ts b/src/migrator/config.ts index 054a561..0f9da65 100644 --- a/src/migrator/config.ts +++ b/src/migrator/config.ts @@ -16,6 +16,7 @@ export const vueSpecialMethods = [ 'activated', 'deactivated', 'serverPrefetch', + 'beforeDestroy', 'destroyed', ]; // Vue methods that won't be included under methods: {...}, they go to the root.