Skip to content

Commit 70c3ac7

Browse files
authored
dx(compiler-sfc): warn when disabled defineModel (#8534)
1 parent 24db951 commit 70c3ac7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/compiler-sfc/src/script/defineModel.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,15 @@ export function processDefineModel(
2424
node: Node,
2525
declId?: LVal
2626
): boolean {
27-
if (!ctx.options.defineModel || !isCallOf(node, DEFINE_MODEL)) {
27+
if (!isCallOf(node, DEFINE_MODEL)) {
28+
return false
29+
}
30+
31+
if (!ctx.options.defineModel) {
32+
warnOnce(
33+
`defineModel() is an experimental feature and disabled by default.\n` +
34+
`To enable it, follow the RFC at https://github.com/vuejs/rfcs/discussions/503.`
35+
)
2836
return false
2937
}
3038

0 commit comments

Comments
 (0)