Skip to content

Commit

Permalink
dx(compiler-sfc): warn when disabled defineModel (#8534)
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz authored Jul 12, 2023
1 parent 24db951 commit 70c3ac7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/compiler-sfc/src/script/defineModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ export function processDefineModel(
node: Node,
declId?: LVal
): boolean {
if (!ctx.options.defineModel || !isCallOf(node, DEFINE_MODEL)) {
if (!isCallOf(node, DEFINE_MODEL)) {
return false
}

if (!ctx.options.defineModel) {
warnOnce(
`defineModel() is an experimental feature and disabled by default.\n` +
`To enable it, follow the RFC at https://github.com/vuejs/rfcs/discussions/503.`
)
return false
}

Expand Down

0 comments on commit 70c3ac7

Please sign in to comment.