Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2d4a32d

Browse files
yyx990803sxzz
andauthored
feat: compat for Vue 3.4 (#567)
Co-authored-by: 三咲智子 Kevin Deng <sxzz@sxzz.moe>
1 parent033ff02 commit2d4a32d

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

‎.changeset/rotten-buckets-agree.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vue-macros/setup-block':patch
3+
---
4+
5+
compat for Vue 3.4

‎packages/setup-block/src/core/index.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
12
import{MagicString,generateTransform}from'@vue-macros/common'
2-
import{typeNodeTypes,typeTextModes,parse}from'@vue/compiler-dom'
3+
import{typeElementNode,typeNodeTypes,parse}from'@vue/compiler-dom'
34

45
exportfunctiontransformSetupBlock(code:string,id:string,lang?:string){
56
consts=newMagicString(code)
67

78
constnode=parse(code,{
9+
//@ts-ignore TODO remove ignore in 3.4
10+
parseMode:'sfc',
811
// there are no components at SFC parsing level
912
isNativeTag:()=>true,
1013
// preserve all whitespaces
1114
isPreTag:()=>true,
12-
getTextMode:({ tag, props},parent)=>{
15+
//@ts-ignore (this has been removed in Vue 3.4)
16+
getTextMode:({ tag, props}:ElementNode,parent)=>{
1317
// all top level elements except <template> are parsed as raw text
1418
// containers
1519
if(
@@ -25,9 +29,9 @@ export function transformSetupBlock(code: string, id: string, lang?: string) {
2529
p.value.content!=='html',
2630
))
2731
){
28-
return2satisfiesTextModes.RAWTEXT
32+
return2
2933
}else{
30-
return0satisfiesTextModes.DATA
34+
return0
3135
}
3236
},
3337
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp