1
1
// Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
3
- exports [` SFC compile <script setup > CSS vars injection <script > w/ default export 1`] = `
4
- "const __default__ = { setup () {} }
5
- import { useCssVars as _useCssVars } from 'vue'
6
- const __injectCSSVars__ = () => {
7
- _useCssVars (_ctx => ({ color: _ctx .color }))
8
- }
9
- const __setup__ = __default__.setup
10
- __default__.setup = __setup__
11
- ? (props, ctx) => { __injectCSSVars__ ();return __setup__ (props , ctx ) }
12
- : __injectCSSVars__
13
- export default __default__"
14
- `;
15
-
16
- exports[`SFC compile <script setup > CSS vars injection <script > w/ default export in strings/comments 1`] = `
17
- "
18
- // export default { }
19
- const __default__ = { }
20
-
21
- import { useCssVars as _useCssVars } from 'vue'
22
- const __injectCSSVars__ = () => {
23
- _useCssVars (_ctx => ({ color: _ctx .color }))
24
- }
25
- const __setup__ = __default__.setup
26
- __default__.setup = __setup__
27
- ? (props, ctx) => { __injectCSSVars__ ();return __setup__ (props , ctx ) }
28
- : __injectCSSVars__
29
- export default __default__"
30
- `;
31
-
32
- exports[`SFC compile <script setup > CSS vars injection <script > w/ no default export 1`] = `
33
- "const a = 1
34
- const __default__ = { }
35
- import { useCssVars as _useCssVars } from 'vue'
36
- const __injectCSSVars__ = () => {
37
- _useCssVars (_ctx => ({ color: _ctx .color }))
38
- }
39
- const __setup__ = __default__.setup
40
- __default__.setup = __setup__
41
- ? (props, ctx) => { __injectCSSVars__ ();return __setup__ (props , ctx ) }
42
- : __injectCSSVars__
43
- export default __default__"
44
- `;
45
-
46
- exports[`SFC compile <script setup > CSS vars injection w/ <script setup > 1`] = `
47
- "import { useCssVars as _useCssVars } from 'vue'
48
-
49
- export default {
50
- expose : [],
51
- setup () {
52
- const color = 'red'
53
- _useCssVars(_ctx = > ({ color }))
54
- return { color }
55
- }
56
-
57
- } "
58
- `;
59
-
60
3
exports [` SFC compile <script setup > defineOptions() 1`] = `
61
4
"export default {
62
5
expose : [],
@@ -86,7 +29,7 @@ export default {
86
29
default : () => bar
87
30
}
88
31
},
89
- setup () {
32
+ setup (__props ) {
90
33
91
34
92
35
@@ -104,7 +47,7 @@ exports[`SFC compile <script setup> errors should allow defineOptions() referenc
104
47
default : bar => bar + 1
105
48
}
106
49
},
107
- setup () {
50
+ setup (__props ) {
108
51
109
52
const bar = 1
110
53
@@ -121,7 +64,7 @@ import { ref } from 'vue'
121
64
122
65
export default {
123
66
expose : [],
124
- setup () {
67
+ setup (__props ) {
125
68
126
69
const foo = _ref(1)
127
70
@@ -136,7 +79,7 @@ exports[`SFC compile <script setup> imports import dedupe between <script> and <
136
79
137
80
export default {
138
81
expose : [],
139
- setup () {
82
+ setup (__props ) {
140
83
141
84
x()
142
85
@@ -152,7 +95,7 @@ exports[`SFC compile <script setup> imports should extract comment for import or
152
95
153
96
export default {
154
97
expose : [],
155
- setup () {
98
+ setup (__props ) {
156
99
157
100
158
101
return { a , b }
@@ -165,7 +108,7 @@ exports[`SFC compile <script setup> imports should hoist and expose imports 1`]
165
108
"import { ref } from 'vue'
166
109
export default {
167
110
expose : [],
168
- setup () {
111
+ setup (__props ) {
169
112
170
113
return { ref }
171
114
}
@@ -182,13 +125,13 @@ import { ref } from 'vue'
182
125
183
126
export default {
184
127
expose : [],
185
- setup () {
128
+ setup (__props ) {
186
129
187
130
const count = ref(0)
188
131
const constant = {}
189
132
function fn() {}
190
133
191
- return (_ctx , _cache , $props , $setup , $data , $options ) => {
134
+ return (_ctx , _cache ) => {
192
135
return (_openBlock (), _createBlock (_Fragment , null , [
193
136
_createVNode (Foo ),
194
137
_createVNode (\\" div\\ " , { onClick: fn }, _toDisplayString (_unref (count )) + \\" \\ " + _toDisplayString (constant ) + \\" \\ " + _toDisplayString (_unref (other )), 1 /* TEXT */ )
@@ -208,11 +151,11 @@ import { ref } from 'vue'
208
151
209
152
export default {
210
153
expose : [],
211
- setup () {
154
+ setup (__props ) {
212
155
213
156
const count = ref(0)
214
157
215
- return (_ctx , _cache , $props , $setup , $data , $options ) => {
158
+ return (_ctx , _cache ) => {
216
159
return (_openBlock (), _createBlock (_Fragment , null , [
217
160
_createVNode (\\" div\\ " , null , _toDisplayString (_unref (count )), 1 /* TEXT */ ),
218
161
_hoisted_1
@@ -228,7 +171,7 @@ exports[`SFC compile <script setup> ref: syntax sugar accessing ref binding 1`]
228
171
229
172
export default {
230
173
expose : [],
231
- setup () {
174
+ setup (__props ) {
232
175
233
176
const a = _ref(1)
234
177
console.log(a .value )
@@ -247,7 +190,7 @@ exports[`SFC compile <script setup> ref: syntax sugar array destructure 1`] = `
247
190
248
191
export default {
249
192
expose : [],
250
- setup () {
193
+ setup (__props ) {
251
194
252
195
const n = _ref(1), [__a , __b = 1, ... __c ] = useFoo ()
253
196
const a = _ref (__a );
@@ -266,7 +209,7 @@ exports[`SFC compile <script setup> ref: syntax sugar convert ref declarations 1
266
209
267
210
export default {
268
211
expose : [],
269
- setup () {
212
+ setup (__props ) {
270
213
271
214
const foo = _ref()
272
215
const a = _ref(1)
@@ -287,7 +230,7 @@ exports[`SFC compile <script setup> ref: syntax sugar multi ref declarations 1`]
287
230
288
231
export default {
289
232
expose : [],
290
- setup () {
233
+ setup (__props ) {
291
234
292
235
const a = _ref(1), b = _ref(2), c = _ref({
293
236
count : 0
@@ -304,7 +247,7 @@ exports[`SFC compile <script setup> ref: syntax sugar mutating ref binding 1`] =
304
247
305
248
export default {
306
249
expose : [],
307
- setup () {
250
+ setup (__props ) {
308
251
309
252
const a = _ref(1)
310
253
const b = _ref({ count : 0 })
@@ -326,7 +269,7 @@ exports[`SFC compile <script setup> ref: syntax sugar nested destructure 1`] = `
326
269
327
270
export default {
328
271
expose : [],
329
- setup () {
272
+ setup (__props ) {
330
273
331
274
const [{ a: { b: __b }}] = useFoo ()
332
275
const b = _ref (__b );
@@ -346,7 +289,7 @@ exports[`SFC compile <script setup> ref: syntax sugar object destructure 1`] = `
346
289
347
290
export default {
348
291
expose : [],
349
- setup () {
292
+ setup (__props ) {
350
293
351
294
const n = _ref(1), { a: __a , b: __c , d: __d = 1 , e: __f = 2 , ... __g } = useFoo ()
352
295
const a = _ref (__a );
@@ -365,7 +308,7 @@ return { n, a, c, d, f, g }
365
308
exports[`SFC compile <script setup > ref: syntax sugar should not convert non ref labels 1`] = `
366
309
"export default {
367
310
expose : [],
368
- setup () {
311
+ setup (__props ) {
369
312
370
313
foo: a = 1 , b = 2, c = {
371
314
count: 0
@@ -382,7 +325,7 @@ exports[`SFC compile <script setup> ref: syntax sugar using ref binding in prope
382
325
383
326
export default {
384
327
expose : [],
385
- setup () {
328
+ setup (__props ) {
386
329
387
330
const a = _ref(1)
388
331
const b = { a : a .value }
@@ -401,7 +344,7 @@ exports[`SFC compile <script setup> should expose top level declarations 1`] = `
401
344
402
345
export default {
403
346
expose : [],
404
- setup () {
347
+ setup (__props ) {
405
348
406
349
let a = 1
407
350
const b = 2
@@ -509,7 +452,7 @@ export default _defineComponent({
509
452
literalUnionMixed: { type: [String , Number , Boolean ], required: true },
510
453
intersection: { type: Object , required: true }
511
454
} as unknown as undefined ,
512
- setup () {
455
+ setup (__props ) {
513
456
514
457
515
458
@@ -526,7 +469,7 @@ export interface Foo {}
526
469
527
470
export default _defineComponent({
528
471
expose : [],
529
- setup () {
472
+ setup (__props ) {
530
473
531
474
532
475
return { }
0 commit comments