Skip to content

Commit

Permalink
fix: address transition type incompatibility with Vue 2.7.16 (#3882)
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl authored Feb 29, 2024
1 parent 09c0480 commit 89c38ef
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
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:[email protected]"
"vue2": "npm:[email protected].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

0 comments on commit 89c38ef

Please sign in to comment.