From 1e24322b9978ca61fb99f1a37f260cf50e0e89f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90=20Kevin=20Deng?= Date: Thu, 1 Aug 2024 22:10:59 +0800 Subject: [PATCH] fix(plugin-vue): add deprecated `script.propsDestructure` option fixes https://github.com/nuxt/nuxt/issues/28295 closes #431 --- packages/plugin-vue/src/index.ts | 4 ++++ packages/plugin-vue/src/script.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/plugin-vue/src/index.ts b/packages/plugin-vue/src/index.ts index be233ff2..17d00add 100644 --- a/packages/plugin-vue/src/index.ts +++ b/packages/plugin-vue/src/index.ts @@ -58,6 +58,10 @@ export interface Options { * using Vue 3.4 or above. */ defineModel?: boolean + /** + * @deprecated moved to `features.propsDestructure`. + */ + propsDestructure?: boolean } template?: Partial< Omit< diff --git a/packages/plugin-vue/src/script.ts b/packages/plugin-vue/src/script.ts index 4c97a0a6..15b15ccd 100644 --- a/packages/plugin-vue/src/script.ts +++ b/packages/plugin-vue/src/script.ts @@ -82,7 +82,8 @@ export function resolveScript( ? scriptIdentifier : undefined, customElement, - propsDestructure: options.features?.propsDestructure, + propsDestructure: + options.features?.propsDestructure ?? options.script?.propsDestructure, }) if (!options.isProduction && resolved?.deps) {