Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: address transition type incompatibility with Vue 2.7.16 #3882

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/language-core/src/generators/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,15 @@ export function generate(
continue;
}

if (
vueCompilerOptions.target < 3
&& (node.tag === 'transition' || node.tag === 'Transition')
&& prop.name === 'persisted'
) {
// Vue 2 Transition doesn't support "persisted" property but `@vue/compiler-dom always adds it (#3881)
continue;
}

let camelized = false;

if (
Expand Down
25 changes: 18 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"devDependencies": {
"vue": "^3.3.0",
"vue-component-type-helpers": "1.8.27",
"vue2": "npm:vue@2.7"
"vue2": "npm:vue@2.7.16"
}
}
10 changes: 10 additions & 0 deletions test-workspace/tsc/vue2_strictTemplate/#3881/main.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<template>
<div>
<transition>
<span v-show="true">foo</span>
</transition>
<Transition>
<span v-show="true">foo</span>
</Transition>
</div>
</template>
1 change: 1 addition & 0 deletions test-workspace/tsc/vue2_strictTemplate/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"target": 2.7,
},
"include": [
"**/*",
"../vue2/env.d.ts",
"../vue3_strictTemplate",
],
Expand Down
Loading