1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
| {
type: 'script',
content: "import { defineComponent as _defineComponent } from 'vue'\n" +
"import { ref } from 'vue'\n" +
'\n' +
'\n' +
'export default /*#__PURE__*/_defineComponent({\n' +
' setup(__props, { expose }) {\n' +
' expose();\n' +
'\n' +
"const name = ref('jack');\n" +
'\n' +
'const __returned__ = { name }\n' +
"Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })\n" +
'return __returned__\n' +
'}\n' +
'\n' +
'})',
loc: {
source: "\nimport { ref } from 'vue'\n\nconst name = ref('jack');\n",
start: { column: 25, line: 4, offset: 86 },
end: { column: 1, line: 8, offset: 140 }
},
attrs: { lang: 'ts', setup: true },
lang: 'ts',
setup: true,
bindings: { ref: 'setup-const', name: 'setup-ref' },
imports: [Object: null prototype] {
ref: {
isType: false,
imported: 'ref',
source: 'vue',
isFromSetup: true,
isUsedInTemplate: false
}
},
map: SourceMap {
version: 3,
file: null,
sources: [ 'foo.vue' ],
sourcesContent: [
'<template>\n' +
' <input type="text" v-model="name">\n' +
'</template>\n' +
"<script lang='ts' setup>\n" +
"import { ref } from 'vue'\n" +
'\n' +
"const name = ref('jack');\n" +
'</script>\n' +
'<style lang="scss">\n' +
'input {\n' +
' color: #333;\n' +
'}\n' +
'</style>\n'
],
names: [],
mappings: ';AAIA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzB;;;;;AAFwB;AAGxB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;'
},
scriptAst: undefined,
scriptSetupAst: [
Node {
type: 'ImportDeclaration',
start: 1,
end: 26,
loc: [SourceLocation],
importKind: 'value',
specifiers: [Array],
source: [Node]
},
Node {
type: 'VariableDeclaration',
start: 28,
end: 53,
loc: [SourceLocation],
declarations: [Array],
kind: 'const'
}
]
}
|