1
1
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
3
- exports [` SFC analyze <script > bindings > auto name inference > basic 1`] = `
4
- "const a = 1
5
- export default {
6
- __name : ' FooBar' ,
7
- setup (__props , { expose: __expose }) {
8
- __expose();
9
-
10
- return { a }
11
- }
12
-
13
- }"
14
- `;
15
-
16
- exports[`SFC analyze <script > bindings > auto name inference > do not overwrite manual name (call) 1`] = `
17
- "import { defineComponent } from 'vue'
18
- const __default__ = defineComponent({
19
- name : ' Baz'
20
- } )
21
-
22
- export default /*#__PURE__*/Object.assign(__default__, {
23
- setup (__props , { expose: __expose }) {
24
- __expose();
25
- const a = 1
26
- return { a , defineComponent }
27
- }
28
-
29
- })"
30
- `;
31
-
32
- exports[`SFC analyze <script > bindings > auto name inference > do not overwrite manual name (object) 1`] = `
33
- "const __default__ = {
34
- name : ' Baz'
35
- }
36
-
37
- export default /*#__PURE__*/Object.assign(__default__, {
38
- setup (__props , { expose: __expose }) {
39
- __expose();
40
- const a = 1
41
- return { a }
42
- }
43
-
44
- })"
45
- `;
46
-
47
3
exports [` SFC compile <script setup > > <script > and <script setup > co-usage > export call expression as default 1`] = `
48
4
"function fn() {
49
5
return \\" hello, world\\ " ;
@@ -920,7 +876,8 @@ import { ref } from 'vue'
920
876
import * as tree from './tree'
921
877
922
878
export default {
923
- setup (__props ) {
879
+ setup (__props , { expose: __expose }) {
880
+ __expose();
924
881
925
882
const count = ref(0)
926
883
const constant = {}
@@ -953,7 +910,8 @@ import ChildComp from './Child.vue'
953
910
import vMyDir from './my-dir'
954
911
955
912
export default {
956
- setup (__props ) {
913
+ setup (__props , { expose: __expose }) {
914
+ __expose();
957
915
958
916
959
917
return (_ctx , _cache ) => {
@@ -978,7 +936,8 @@ const _hoisted_1 = /*#__PURE__*/_createElementVNode(\\"div\\", null, \\"static\\
978
936
import { ref } from 'vue'
979
937
980
938
export default {
981
- setup (__props ) {
939
+ setup (__props , { expose: __expose }) {
940
+ __expose();
982
941
983
942
const count = ref(0)
984
943
@@ -1000,7 +959,8 @@ import { ref } from 'vue'
1000
959
1001
960
export default {
1002
961
__ssrInlineRender : true ,
1003
- setup (__props ) {
962
+ setup (__props , { expose: __expose }) {
963
+ __expose();
1004
964
1005
965
const count = ref(0)
1006
966
@@ -1027,7 +987,8 @@ exports[`SFC compile <script setup> > inlineTemplate mode > template assignment
1027
987
import { ref } from 'vue'
1028
988
1029
989
export default {
1030
- setup (__props ) {
990
+ setup (__props , { expose: __expose }) {
991
+ __expose();
1031
992
1032
993
const count = ref(0)
1033
994
const maybe = foo()
@@ -1084,7 +1045,8 @@ exports[`SFC compile <script setup> > inlineTemplate mode > template destructure
1084
1045
import { ref } from 'vue'
1085
1046
1086
1047
export default {
1087
- setup (__props ) {
1048
+ setup (__props , { expose: __expose }) {
1049
+ __expose();
1088
1050
1089
1051
const val = {}
1090
1052
const count = ref (0 )
@@ -1115,7 +1077,8 @@ exports[`SFC compile <script setup> > inlineTemplate mode > template update expr
1115
1077
import { ref } from 'vue'
1116
1078
1117
1079
export default {
1118
- setup (__props ) {
1080
+ setup (__props , { expose: __expose }) {
1081
+ __expose();
1119
1082
1120
1083
const count = ref(0)
1121
1084
const maybe = foo()
@@ -1154,7 +1117,8 @@ exports[`SFC compile <script setup> > inlineTemplate mode > v-model codegen 1`]
1154
1117
import { ref } from 'vue'
1155
1118
1156
1119
export default {
1157
- setup (__props ) {
1120
+ setup (__props , { expose: __expose }) {
1121
+ __expose();
1158
1122
1159
1123
const count = ref(0)
1160
1124
const maybe = foo()
@@ -1317,102 +1281,3 @@ return { D, C, B, Foo }
1317
1281
1318
1282
})"
1319
1283
`;
1320
-
1321
- exports[`SFC genDefaultAs > <script setup > only 1`] = `
1322
- "const a = 1
1323
-
1324
- const _sfc_ = {
1325
- setup (__props , { expose: __expose }) {
1326
- __expose();
1327
-
1328
-
1329
- return { a }
1330
- }
1331
-
1332
- }"
1333
- `;
1334
-
1335
- exports[`SFC genDefaultAs > <script setup > only w/ ts 1`] = `
1336
- "import { defineComponent as _defineComponent } from 'vue'
1337
- const a = 1
1338
-
1339
- const _sfc_ = /*#__PURE__*/_defineComponent({
1340
- setup (__props , { expose: __expose }) {
1341
- __expose();
1342
-
1343
-
1344
- return { a }
1345
- }
1346
-
1347
- })"
1348
- `;
1349
-
1350
- exports[`SFC genDefaultAs > <script > + <script setup > 1`] = `
1351
- "const __default__ = { }
1352
-
1353
- const _sfc_ = /*#__PURE__*/Object.assign(__default__, {
1354
- setup (__props , { expose: __expose }) {
1355
- __expose();
1356
-
1357
- const a = 1
1358
-
1359
- return { a }
1360
- }
1361
-
1362
- })"
1363
- `;
1364
-
1365
- exports[`SFC genDefaultAs > <script > + <script setup > 2`] = `
1366
- "const __default__ = { }
1367
-
1368
- const _sfc_ = /*#__PURE__*/Object.assign(__default__, {
1369
- setup (__props , { expose: __expose }) {
1370
- __expose();
1371
-
1372
- const a = 1
1373
-
1374
- return { a }
1375
- }
1376
-
1377
- })"
1378
- `;
1379
-
1380
- exports[`SFC genDefaultAs > <script > + <script setup > w/ ts 1`] = `
1381
- "import { defineComponent as _defineComponent } from 'vue'
1382
-
1383
- const __default__ = { }
1384
-
1385
- const _sfc_ = /*#__PURE__*/_defineComponent({
1386
- ... __default__ ,
1387
- setup (__props , { expose: __expose }) {
1388
- __expose();
1389
-
1390
- const a = 1
1391
-
1392
- return { a }
1393
- }
1394
-
1395
- })"
1396
- `;
1397
-
1398
- exports[`SFC genDefaultAs > normal <script > only 1`] = `
1399
- "
1400
- const _sfc_ = { }
1401
- "
1402
- `;
1403
-
1404
- exports[`SFC genDefaultAs > normal <script > w/ cssVars 1`] = `
1405
- "
1406
- const _sfc_ = { }
1407
-
1408
- import { useCssVars as _useCssVars } from 'vue'
1409
- const __injectCSSVars__ = () => {
1410
- _useCssVars (_ctx => ({
1411
- \\" xxxxxxxx-x\\ " : (_ctx .x )
1412
- }))}
1413
- const __setup__ = _sfc_.setup
1414
- _sfc_.setup = __setup__
1415
- ? (props, ctx) => { __injectCSSVars__ ();return __setup__ (props , ctx ) }
1416
- : __injectCSSVars__
1417
- "
1418
- `;
0 commit comments