2
2
3
3
exports [` SFC compile <script setup > CSS vars injection <script > w/ default export 1`] = `
4
4
"const __default__ = { setup () {} }
5
- import { useCssVars as __useCssVars__ } from 'vue'
5
+ import { useCssVars as _useCssVars } from 'vue'
6
6
const __injectCSSVars__ = () => {
7
- __useCssVars__ (_ctx => ({ color: _ctx .color }))
7
+ _useCssVars (_ctx => ({ color: _ctx .color }))
8
8
}
9
9
const __setup__ = __default__.setup
10
10
__default__.setup = __setup__
@@ -18,9 +18,9 @@ exports[`SFC compile <script setup> CSS vars injection <script> w/ default expor
18
18
// export default { }
19
19
const __default__ = { }
20
20
21
- import { useCssVars as __useCssVars__ } from 'vue'
21
+ import { useCssVars as _useCssVars } from 'vue'
22
22
const __injectCSSVars__ = () => {
23
- __useCssVars__ (_ctx => ({ color: _ctx .color }))
23
+ _useCssVars (_ctx => ({ color: _ctx .color }))
24
24
}
25
25
const __setup__ = __default__.setup
26
26
__default__.setup = __setup__
@@ -32,9 +32,9 @@ export default __default__"
32
32
exports[`SFC compile <script setup > CSS vars injection <script > w/ no default export 1`] = `
33
33
"const a = 1
34
34
const __default__ = { }
35
- import { useCssVars as __useCssVars__ } from 'vue'
35
+ import { useCssVars as _useCssVars } from 'vue'
36
36
const __injectCSSVars__ = () => {
37
- __useCssVars__ (_ctx => ({ color: _ctx .color }))
37
+ _useCssVars (_ctx => ({ color: _ctx .color }))
38
38
}
39
39
const __setup__ = __default__.setup
40
40
__default__.setup = __setup__
@@ -44,12 +44,13 @@ export default __default__"
44
44
`;
45
45
46
46
exports[`SFC compile <script setup > CSS vars injection w/ <script setup > 1`] = `
47
- "import { useCssVars } from 'vue'
47
+ "import { useCssVars as _useCssVars } from 'vue'
48
48
49
49
export default {
50
+ expose : [],
50
51
setup () {
51
52
const color = 'red'
52
- __useCssVars__ (_ctx = > ({ color }))
53
+ _useCssVars (_ctx = > ({ color }))
53
54
return { color }
54
55
}
55
56
@@ -58,6 +59,7 @@ return { color }
58
59
59
60
exports[`SFC compile <script setup > defineOptions() 1`] = `
60
61
"export default {
62
+ expose : [],
61
63
props : {
62
64
foo: String
63
65
},
@@ -78,6 +80,7 @@ exports[`SFC compile <script setup> errors should allow defineOptions() referenc
78
80
"import { bar } from './bar'
79
81
80
82
export default {
83
+ expose : [],
81
84
props : {
82
85
foo: {
83
86
default : () => bar
@@ -95,6 +98,7 @@ return { bar }
95
98
96
99
exports[`SFC compile <script setup > errors should allow defineOptions() referencing scope var 1`] = `
97
100
"export default {
101
+ expose : [],
98
102
props : {
99
103
foo: {
100
104
default : bar => bar + 1
@@ -112,12 +116,14 @@ return { bar }
112
116
`;
113
117
114
118
exports[`SFC compile <script setup > imports dedupe between user & helper 1`] = `
115
- "import { ref } from 'vue'
119
+ "import { ref as _ref } from 'vue'
120
+ import { ref } from 'vue'
116
121
117
122
export default {
123
+ expose : [],
118
124
setup () {
119
125
120
- const foo = ref (1)
126
+ const foo = _ref (1)
121
127
122
128
return { foo , ref }
123
129
}
@@ -129,6 +135,7 @@ exports[`SFC compile <script setup> imports import dedupe between <script> and <
129
135
"import { x } from './x'
130
136
131
137
export default {
138
+ expose : [],
132
139
setup () {
133
140
134
141
x()
@@ -144,6 +151,7 @@ exports[`SFC compile <script setup> imports should extract comment for import or
144
151
import b from 'b'
145
152
146
153
export default {
154
+ expose : [],
147
155
setup () {
148
156
149
157
@@ -156,6 +164,7 @@ return { a, b }
156
164
exports[`SFC compile <script setup > imports should hoist and expose imports 1`] = `
157
165
"import { ref } from 'vue'
158
166
export default {
167
+ expose : [],
159
168
setup () {
160
169
161
170
return { ref }
@@ -172,6 +181,7 @@ import { ref } from 'vue'
172
181
import other from './util'
173
182
174
183
export default {
184
+ expose : [],
175
185
setup () {
176
186
177
187
const count = ref(0)
@@ -197,6 +207,7 @@ const _hoisted_1 = /*#__PURE__*/_createVNode(\\"div\\", null, \\"static\\", -1 /
197
207
import { ref } from 'vue'
198
208
199
209
export default {
210
+ expose : [],
200
211
setup () {
201
212
202
213
const count = ref(0)
@@ -213,12 +224,13 @@ return (_ctx, _cache, $props, $setup, $data, $options) => {
213
224
`;
214
225
215
226
exports[`SFC compile <script setup > ref: syntax sugar accessing ref binding 1`] = `
216
- "import { ref } from 'vue'
227
+ "import { ref as _ref } from 'vue'
217
228
218
229
export default {
230
+ expose : [],
219
231
setup () {
220
232
221
- const a = ref (1)
233
+ const a = _ref (1)
222
234
console.log(a .value )
223
235
function get() {
224
236
return a .value + 1
@@ -231,15 +243,16 @@ return { a, get }
231
243
`;
232
244
233
245
exports[`SFC compile <script setup > ref: syntax sugar array destructure 1`] = `
234
- "import { ref } from 'vue'
246
+ "import { ref as _ref } from 'vue'
235
247
236
248
export default {
249
+ expose : [],
237
250
setup () {
238
251
239
- const n = ref (1), [__a , __b = 1, ... __c ] = useFoo ()
240
- const a = ref (__a );
241
- const b = ref (__b );
242
- const c = ref (__c );
252
+ const n = _ref (1), [__a , __b = 1, ... __c ] = useFoo ()
253
+ const a = _ref (__a );
254
+ const b = _ref (__b );
255
+ const c = _ref (__c );
243
256
console .log (n .value , a .value , b .value , c .value )
244
257
245
258
return { n , a , b , c }
@@ -249,14 +262,15 @@ return { n, a, b, c }
249
262
`;
250
263
251
264
exports[`SFC compile <script setup > ref: syntax sugar convert ref declarations 1`] = `
252
- "import { ref } from 'vue'
265
+ "import { ref as _ref } from 'vue'
253
266
254
267
export default {
268
+ expose : [],
255
269
setup () {
256
270
257
- const foo = ref ()
258
- const a = ref (1)
259
- const b = ref ({
271
+ const foo = _ref ()
272
+ const a = _ref (1)
273
+ const b = _ref ({
260
274
count : 0
261
275
})
262
276
let c = () => {}
@@ -269,12 +283,13 @@ return { foo, a, b, c, d }
269
283
`;
270
284
271
285
exports[`SFC compile <script setup > ref: syntax sugar multi ref declarations 1`] = `
272
- "import { ref } from 'vue'
286
+ "import { ref as _ref } from 'vue'
273
287
274
288
export default {
289
+ expose : [],
275
290
setup () {
276
291
277
- const a = ref (1), b = ref (2), c = ref ({
292
+ const a = _ref (1), b = _ref (2), c = _ref ({
278
293
count : 0
279
294
})
280
295
@@ -285,13 +300,14 @@ return { a, b, c }
285
300
`;
286
301
287
302
exports[`SFC compile <script setup > ref: syntax sugar mutating ref binding 1`] = `
288
- "import { ref } from 'vue'
303
+ "import { ref as _ref } from 'vue'
289
304
290
305
export default {
306
+ expose : [],
291
307
setup () {
292
308
293
- const a = ref (1)
294
- const b = ref ({ count : 0 })
309
+ const a = _ref (1)
310
+ const b = _ref ({ count : 0 })
295
311
function inc() {
296
312
a .value ++
297
313
a .value = a .value + 1
@@ -306,16 +322,17 @@ return { a, b, inc }
306
322
`;
307
323
308
324
exports[`SFC compile <script setup > ref: syntax sugar nested destructure 1`] = `
309
- "import { ref } from 'vue'
325
+ "import { ref as _ref } from 'vue'
310
326
311
327
export default {
328
+ expose : [],
312
329
setup () {
313
330
314
331
const [{ a: { b: __b }}] = useFoo ()
315
- const b = ref (__b );
332
+ const b = _ref (__b );
316
333
const { c: [__d , __e ] } = useBar ()
317
- const d = ref (__d );
318
- const e = ref (__e );
334
+ const d = _ref (__d );
335
+ const e = _ref (__e );
319
336
console .log (b .value , d .value , e .value )
320
337
321
338
return { b , d , e }
@@ -325,17 +342,18 @@ return { b, d, e }
325
342
`;
326
343
327
344
exports[`SFC compile <script setup > ref: syntax sugar object destructure 1`] = `
328
- "import { ref } from 'vue'
345
+ "import { ref as _ref } from 'vue'
329
346
330
347
export default {
348
+ expose : [],
331
349
setup () {
332
350
333
- const n = ref (1), { a: __a , b: __c , d: __d = 1 , e: __f = 2 , ... __g } = useFoo ()
334
- const a = ref (__a );
335
- const c = ref (__c );
336
- const d = ref (__d );
337
- const f = ref (__f );
338
- const g = ref (__g );
351
+ const n = _ref (1), { a: __a , b: __c , d: __d = 1 , e: __f = 2 , ... __g } = useFoo ()
352
+ const a = _ref (__a );
353
+ const c = _ref (__c );
354
+ const d = _ref (__d );
355
+ const f = _ref (__f );
356
+ const g = _ref (__g );
339
357
console .log (n .value , a .value , c .value , d .value , f .value , g .value )
340
358
341
359
return { n , a , c , d , f , g }
@@ -346,6 +364,7 @@ return { n, a, c, d, f, g }
346
364
347
365
exports[`SFC compile <script setup > ref: syntax sugar should not convert non ref labels 1`] = `
348
366
"export default {
367
+ expose : [],
349
368
setup () {
350
369
351
370
foo: a = 1 , b = 2, c = {
@@ -359,12 +378,13 @@ return { }
359
378
`;
360
379
361
380
exports[`SFC compile <script setup > ref: syntax sugar using ref binding in property shorthand 1`] = `
362
- "import { ref } from 'vue'
381
+ "import { ref as _ref } from 'vue'
363
382
364
383
export default {
384
+ expose : [],
365
385
setup () {
366
386
367
- const a = ref (1)
387
+ const a = _ref (1)
368
388
const b = { a : a .value }
369
389
function test() {
370
390
const { a } = b
@@ -380,6 +400,7 @@ exports[`SFC compile <script setup> should expose top level declarations 1`] = `
380
400
"import { x } from './x'
381
401
382
402
export default {
403
+ expose : [],
383
404
setup () {
384
405
385
406
let a = 1
@@ -394,10 +415,11 @@ return { a, b, c, d, x }
394
415
`;
395
416
396
417
exports[`SFC compile <script setup > with TypeScript defineOptions w/ runtime options 1`] = `
397
- "import { defineComponent } from 'vue'
418
+ "import { defineComponent as _defineComponent } from 'vue'
398
419
399
420
400
- export default defineComponent({
421
+ export default _defineComponent({
422
+ expose : [],
401
423
props : { foo: String },
402
424
emits : [' a' , ' b' ],
403
425
setup (__props , { props , emit }) {
@@ -411,10 +433,11 @@ return { props, emit }
411
433
`;
412
434
413
435
exports[`SFC compile <script setup > with TypeScript defineOptions w/ type / extract emits (union) 1`] = `
414
- "import { Slots , defineComponent } from 'vue'
436
+ "import { Slots as _Slots , defineComponent as _defineComponent } from 'vue'
415
437
416
438
417
- export default defineComponent({
439
+ export default _defineComponent({
440
+ expose : [],
418
441
emits : [\\" foo\\ " , \\" bar\\ " , \\" baz\\ " ] as unknown as undefined ,
419
442
setup (__props , { emit }: {
420
443
props: {},
@@ -432,10 +455,11 @@ return { emit }
432
455
`;
433
456
434
457
exports[`SFC compile <script setup > with TypeScript defineOptions w/ type / extract emits 1`] = `
435
- "import { Slots , defineComponent } from 'vue'
458
+ "import { Slots as _Slots , defineComponent as _defineComponent } from 'vue'
436
459
437
460
438
- export default defineComponent({
461
+ export default _defineComponent({
462
+ expose : [],
439
463
emits : [\\" foo\\ " , \\" bar\\ " ] as unknown as undefined ,
440
464
setup (__props , { emit }: {
441
465
props: {},
@@ -453,14 +477,15 @@ return { emit }
453
477
`;
454
478
455
479
exports[`SFC compile <script setup > with TypeScript defineOptions w/ type / extract props 1`] = `
456
- "import { defineComponent } from 'vue'
480
+ "import { defineComponent as _defineComponent } from 'vue'
457
481
458
482
interface Test { }
459
483
460
484
type Alias = number[]
461
485
462
486
463
- export default defineComponent({
487
+ export default _defineComponent({
488
+ expose : [],
464
489
props : {
465
490
string: { type: String , required: true },
466
491
number: { type: Number , required: true },
@@ -495,11 +520,12 @@ return { }
495
520
`;
496
521
497
522
exports[`SFC compile <script setup > with TypeScript hoist type declarations 1`] = `
498
- "import { defineComponent } from 'vue'
523
+ "import { defineComponent as _defineComponent } from 'vue'
499
524
export interface Foo { }
500
525
type Bar = { }
501
526
502
- export default defineComponent({
527
+ export default _defineComponent({
528
+ expose : [],
503
529
setup () {
504
530
505
531
0 commit comments