fix(compiler-sfc): add error handling for defineModel() without variable assignment #16467
Annotations
2 errors
|
|
|
packages/compiler-sfc/__tests__/compileScript.spec.ts#L987
AssertionError: expected [Function] to throw error including 'cannot reference locally declared var…' but got '[@vue/compiler-sfc] defineModel() mus…'
- Expected
+ Received
- cannot reference locally declared variables
+ [@vue/compiler-sfc] defineModel() must be assigned to a variable. For example: const model = defineModel()
+
+ anonymous.vue
+ 1 | <script setup>
+ 2 | let bar = 1
+ 3 | defineModel({
+ | ^^^^^^^^^^^^^
+ 4 | default: () => bar
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ 5 | })
+ | ^^^^^^^^^^
❯ packages/compiler-sfc/__tests__/compileScript.spec.ts:987:9
|
The logs for this run have expired and are no longer available.
Loading