Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 901bbe3

Browse files
committed
refactor(volar)!: rename shortVmodelPrefix
1 parent e1db377 commit 901bbe3

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

.changeset/forty-pandas-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@vue-macros/volar': minor
3+
---
4+
5+
⚠️ BREAKING: rename `shortVmodelPrefix` to `shortVmodel.prefix`

README-zh-CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ npm i -D @vue-macros/volar
144144
"@vue-macros/volar/short-vmodel"
145145
],
146146
// `shortVmodel` 特性的 prefix
147-
"shortVmodelPrefix": "$"
147+
"shortVmodel": {
148+
"prefix": "$"
149+
}
148150
}
149151
}
150152
```

docs/macros/short-vmodel.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ export default defineConfig({
9696
// ...
9797
],
9898
// prefix
99-
"shortVmodelPrefix": "$"
99+
"shortVmodel": {
100+
"prefix": "$"
101+
}
100102
}
101103
}
102104
```

packages/volar/src/short-vmodel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const plugin: VueLanguagePlugin = ({ vueCompilerOptions }) => {
99
options.nodeTransforms ||= []
1010
options.nodeTransforms.push(
1111
transformShortVmodel({
12-
prefix: (vueCompilerOptions as any)?.shortVmodelPrefix ?? '$',
12+
prefix: (vueCompilerOptions as any)?.shortVmodel?.prefix ?? '$',
1313
})
1414
)
1515
return options

playground/vue3/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"@vue-macros/volar/define-model",
1919
"@vue-macros/volar/short-vmodel"
2020
],
21-
"shortVmodelPrefix": "$"
21+
"shortVmodel": {
22+
"prefix": "$"
23+
}
2224
},
2325
"include": ["src", "*"]
2426
}

0 commit comments

Comments
 (0)