@vue/language-core 2.2.2 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/codegen/globalTypes.js +21 -34
- package/lib/codegen/script/component.js +11 -9
- package/lib/codegen/script/componentSelf.js +4 -11
- package/lib/codegen/script/context.d.ts +0 -1
- package/lib/codegen/script/context.js +0 -1
- package/lib/codegen/script/index.d.ts +1 -4
- package/lib/codegen/script/index.js +8 -12
- package/lib/codegen/script/scriptSetup.js +90 -70
- package/lib/codegen/script/src.d.ts +2 -2
- package/lib/codegen/script/src.js +36 -37
- package/lib/codegen/script/styleModulesType.d.ts +1 -1
- package/lib/codegen/script/styleModulesType.js +2 -2
- package/lib/codegen/script/template.d.ts +1 -2
- package/lib/codegen/script/template.js +5 -53
- package/lib/codegen/style/classProperty.d.ts +2 -0
- package/lib/codegen/style/classProperty.js +18 -0
- package/lib/codegen/style/modules.d.ts +3 -0
- package/lib/codegen/style/modules.js +34 -0
- package/lib/codegen/style/scopedClasses.d.ts +4 -0
- package/lib/codegen/style/scopedClasses.js +32 -0
- package/lib/codegen/template/context.d.ts +106 -5
- package/lib/codegen/template/context.js +131 -6
- package/lib/codegen/template/element.d.ts +1 -1
- package/lib/codegen/template/element.js +74 -97
- package/lib/codegen/template/elementChildren.d.ts +1 -1
- package/lib/codegen/template/elementChildren.js +1 -13
- package/lib/codegen/template/elementDirectives.js +8 -6
- package/lib/codegen/template/elementEvents.d.ts +2 -1
- package/lib/codegen/template/elementEvents.js +52 -28
- package/lib/codegen/template/elementProps.d.ts +1 -1
- package/lib/codegen/template/elementProps.js +23 -20
- package/lib/codegen/template/index.js +29 -14
- package/lib/codegen/template/interpolation.js +5 -5
- package/lib/codegen/template/objectProperty.js +5 -4
- package/lib/codegen/template/propertyAccess.js +1 -1
- package/lib/codegen/template/slotOutlet.js +13 -11
- package/lib/codegen/template/styleScopedClasses.js +8 -58
- package/lib/codegen/template/templateChild.js +60 -28
- package/lib/codegen/template/vFor.js +2 -2
- package/lib/codegen/template/vIf.js +4 -8
- package/lib/codegen/template/vSlot.d.ts +1 -0
- package/lib/codegen/template/vSlot.js +14 -1
- package/lib/codegen/utils/camelized.d.ts +1 -1
- package/lib/codegen/utils/camelized.js +6 -6
- package/lib/codegen/utils/escaped.d.ts +2 -0
- package/lib/codegen/utils/escaped.js +23 -0
- package/lib/codegen/utils/index.d.ts +3 -3
- package/lib/codegen/utils/index.js +19 -15
- package/lib/codegen/utils/objectProperty.d.ts +3 -0
- package/lib/codegen/utils/objectProperty.js +41 -0
- package/lib/codegen/utils/stringLiteralKey.js +2 -1
- package/lib/codegen/utils/unicode.js +2 -2
- package/lib/codegen/utils/wrapWith.d.ts +3 -0
- package/lib/codegen/utils/wrapWith.js +24 -0
- package/lib/parsers/scriptSetupRanges.d.ts +2 -0
- package/lib/parsers/scriptSetupRanges.js +84 -106
- package/lib/plugins/file-md.js +3 -0
- package/lib/plugins/vue-template-inline-ts.js +3 -3
- package/lib/plugins/vue-tsx.d.ts +11 -8
- package/lib/plugins/vue-tsx.js +19 -28
- package/lib/types.d.ts +24 -14
- package/lib/utils/parseSfc.js +40 -16
- package/lib/utils/ts.js +17 -0
- package/lib/virtualFile/computedEmbeddedCodes.js +18 -11
- package/lib/virtualFile/computedSfc.js +21 -28
- package/lib/virtualFile/vueFile.d.ts +7 -10
- package/lib/virtualFile/vueFile.js +10 -4
- package/package.json +2 -2
- package/lib/codeFeatures.d.ts +0 -1
- package/lib/codeFeatures.js +0 -3
- package/lib/codegen/common.d.ts +0 -12
- package/lib/codegen/common.js +0 -79
- package/lib/codegen/script/binding.d.ts +0 -4
- package/lib/codegen/script/binding.js +0 -41
- package/lib/codegen/template/camelized.d.ts +0 -2
- package/lib/codegen/template/camelized.js +0 -31
- package/lib/codegen/utils/src.d.ts +0 -2
- package/lib/codegen/utils/src.js +0 -19
- package/lib/plugins/vue-style-class-names.d.ts +0 -5
- package/lib/plugins/vue-style-class-names.js +0 -32
- package/lib/plugins/vue-style-reference-link.d.ts +0 -1
- package/lib/plugins/vue-style-reference-link.js +0 -3
- package/lib/plugins/vue-style-reference-links.d.ts +0 -3
- package/lib/plugins/vue-style-reference-links.js +0 -26
- package/lib/plugins/vue-vine.d.ts +0 -3
- package/lib/plugins/vue-vine.js +0 -35
- package/lib/utils/findDestructuredProps.d.ts +0 -1
- package/lib/utils/findDestructuredProps.js +0 -3
- package/lib/utils/parseCssImports.d.ts +0 -4
- package/lib/utils/parseCssImports.js +0 -19
|
@@ -8,6 +8,7 @@ const shared_2 = require("../../utils/shared");
|
|
|
8
8
|
const inlayHints_1 = require("../inlayHints");
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
10
|
const camelized_1 = require("../utils/camelized");
|
|
11
|
+
const wrapWith_1 = require("../utils/wrapWith");
|
|
11
12
|
const elementChildren_1 = require("./elementChildren");
|
|
12
13
|
const elementDirectives_1 = require("./elementDirectives");
|
|
13
14
|
const elementEvents_1 = require("./elementEvents");
|
|
@@ -17,7 +18,7 @@ const propertyAccess_1 = require("./propertyAccess");
|
|
|
17
18
|
const styleScopedClasses_1 = require("./styleScopedClasses");
|
|
18
19
|
const vSlot_1 = require("./vSlot");
|
|
19
20
|
const colonReg = /:/g;
|
|
20
|
-
function* generateComponent(options, ctx, node) {
|
|
21
|
+
function* generateComponent(options, ctx, node, isVForChild) {
|
|
21
22
|
const tagOffsets = [node.loc.start.offset + options.template.content.slice(node.loc.start.offset).indexOf(node.tag)];
|
|
22
23
|
if (!node.isSelfClosing && options.template.lang === 'html') {
|
|
23
24
|
const endTagOffset = node.loc.start.offset + node.loc.source.lastIndexOf(node.tag);
|
|
@@ -28,15 +29,13 @@ function* generateComponent(options, ctx, node) {
|
|
|
28
29
|
const failedPropExps = [];
|
|
29
30
|
const possibleOriginalNames = getPossibleOriginalComponentNames(node.tag, true);
|
|
30
31
|
const matchImportName = possibleOriginalNames.find(name => options.scriptSetupImportComponentNames.has(name));
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const var_componentEvents = ctx.getInternalVariable();
|
|
36
|
-
const var_defineComponentCtx = ctx.getInternalVariable();
|
|
32
|
+
const componentOriginalVar = matchImportName ?? ctx.getInternalVariable();
|
|
33
|
+
const componentFunctionalVar = ctx.getInternalVariable();
|
|
34
|
+
const componentVNodeVar = ctx.getInternalVariable();
|
|
35
|
+
const componentCtxVar = ctx.getInternalVariable();
|
|
37
36
|
const isComponentTag = node.tag.toLowerCase() === 'component';
|
|
38
37
|
ctx.currentComponent = {
|
|
39
|
-
ctxVar:
|
|
38
|
+
ctxVar: componentCtxVar,
|
|
40
39
|
used: false
|
|
41
40
|
};
|
|
42
41
|
let props = node.props;
|
|
@@ -69,14 +68,13 @@ function* generateComponent(options, ctx, node) {
|
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
70
|
if (matchImportName) {
|
|
72
|
-
//
|
|
73
|
-
yield
|
|
74
|
-
yield `/** @type { [`;
|
|
71
|
+
// navigation support
|
|
72
|
+
yield `/** @type {[`;
|
|
75
73
|
for (const tagOffset of tagOffsets) {
|
|
76
74
|
yield `typeof `;
|
|
77
|
-
if (
|
|
75
|
+
if (componentOriginalVar === node.tag) {
|
|
78
76
|
yield [
|
|
79
|
-
|
|
77
|
+
componentOriginalVar,
|
|
80
78
|
'template',
|
|
81
79
|
tagOffset,
|
|
82
80
|
ctx.codeFeatures.withoutHighlightAndCompletion,
|
|
@@ -84,7 +82,7 @@ function* generateComponent(options, ctx, node) {
|
|
|
84
82
|
}
|
|
85
83
|
else {
|
|
86
84
|
const shouldCapitalize = matchImportName[0].toUpperCase() === matchImportName[0];
|
|
87
|
-
yield* (0, camelized_1.generateCamelized)(shouldCapitalize ? (0, shared_1.capitalize)(node.tag) : node.tag, tagOffset, {
|
|
85
|
+
yield* (0, camelized_1.generateCamelized)(shouldCapitalize ? (0, shared_1.capitalize)(node.tag) : node.tag, 'template', tagOffset, {
|
|
88
86
|
...ctx.codeFeatures.withoutHighlightAndCompletion,
|
|
89
87
|
navigation: {
|
|
90
88
|
resolveRenameNewName: camelizeComponentName,
|
|
@@ -94,19 +92,19 @@ function* generateComponent(options, ctx, node) {
|
|
|
94
92
|
}
|
|
95
93
|
yield `, `;
|
|
96
94
|
}
|
|
97
|
-
yield `]
|
|
95
|
+
yield `]} */${utils_1.endOfLine}`;
|
|
98
96
|
}
|
|
99
97
|
else if (dynamicTagInfo) {
|
|
100
|
-
yield `const ${
|
|
101
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, dynamicTagInfo.tag, dynamicTagInfo.offsets[0], dynamicTagInfo.astHolder,
|
|
98
|
+
yield `const ${componentOriginalVar} = (`;
|
|
99
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, dynamicTagInfo.tag, dynamicTagInfo.offsets[0], dynamicTagInfo.astHolder, `(`, `)`);
|
|
102
100
|
if (dynamicTagInfo.offsets[1] !== undefined) {
|
|
103
101
|
yield `,`;
|
|
104
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.withoutCompletion, dynamicTagInfo.tag, dynamicTagInfo.offsets[1], dynamicTagInfo.astHolder,
|
|
102
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.withoutCompletion, dynamicTagInfo.tag, dynamicTagInfo.offsets[1], dynamicTagInfo.astHolder, `(`, `)`);
|
|
105
103
|
}
|
|
106
104
|
yield `)${utils_1.endOfLine}`;
|
|
107
105
|
}
|
|
108
106
|
else if (!isComponentTag) {
|
|
109
|
-
yield `const ${
|
|
107
|
+
yield `const ${componentOriginalVar} = ({} as __VLS_WithComponent<'${getCanonicalComponentName(node.tag)}', __VLS_LocalComponents, `;
|
|
110
108
|
if (options.selfComponentName && possibleOriginalNames.includes(options.selfComponentName)) {
|
|
111
109
|
yield `typeof __VLS_self & (new () => { `
|
|
112
110
|
+ (0, shared_2.getSlotsPropertyName)(options.vueCompilerOptions.target)
|
|
@@ -122,14 +120,14 @@ function* generateComponent(options, ctx, node) {
|
|
|
122
120
|
yield* generateCanonicalComponentName(node.tag, tagOffsets[0], ctx.codeFeatures.withoutHighlightAndCompletionAndNavigation);
|
|
123
121
|
yield `${utils_1.endOfLine}`;
|
|
124
122
|
const camelizedTag = (0, shared_1.camelize)(node.tag);
|
|
125
|
-
if (utils_1.
|
|
126
|
-
//
|
|
127
|
-
yield `/** @type {
|
|
123
|
+
if (utils_1.identifierRegex.test(camelizedTag)) {
|
|
124
|
+
// navigation support
|
|
125
|
+
yield `/** @type {[`;
|
|
128
126
|
for (const tagOffset of tagOffsets) {
|
|
129
127
|
for (const shouldCapitalize of (node.tag[0] === node.tag[0].toUpperCase() ? [false] : [true, false])) {
|
|
130
128
|
const expectName = shouldCapitalize ? (0, shared_1.capitalize)(camelizedTag) : camelizedTag;
|
|
131
129
|
yield `typeof __VLS_components.`;
|
|
132
|
-
yield* (0, camelized_1.generateCamelized)(shouldCapitalize ? (0, shared_1.capitalize)(node.tag) : node.tag, tagOffset, {
|
|
130
|
+
yield* (0, camelized_1.generateCamelized)(shouldCapitalize ? (0, shared_1.capitalize)(node.tag) : node.tag, 'template', tagOffset, {
|
|
133
131
|
navigation: {
|
|
134
132
|
resolveRenameNewName: node.tag !== expectName ? camelizeComponentName : undefined,
|
|
135
133
|
resolveRenameEditText: getTagRenameApply(node.tag),
|
|
@@ -138,11 +136,11 @@ function* generateComponent(options, ctx, node) {
|
|
|
138
136
|
yield `, `;
|
|
139
137
|
}
|
|
140
138
|
}
|
|
141
|
-
yield `]
|
|
139
|
+
yield `]} */${utils_1.endOfLine}`;
|
|
142
140
|
// auto import support
|
|
143
141
|
if (options.edited) {
|
|
144
142
|
yield `// @ts-ignore${utils_1.newLine}`; // #2304
|
|
145
|
-
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(node.tag), tagOffsets[0], {
|
|
143
|
+
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(node.tag), 'template', tagOffsets[0], {
|
|
146
144
|
completion: {
|
|
147
145
|
isAdditional: true,
|
|
148
146
|
onlyImport: true,
|
|
@@ -153,65 +151,67 @@ function* generateComponent(options, ctx, node) {
|
|
|
153
151
|
}
|
|
154
152
|
}
|
|
155
153
|
else {
|
|
156
|
-
yield `const ${
|
|
154
|
+
yield `const ${componentOriginalVar} = {} as any${utils_1.endOfLine}`;
|
|
157
155
|
}
|
|
158
156
|
yield `// @ts-ignore${utils_1.newLine}`;
|
|
159
|
-
yield `const ${
|
|
157
|
+
yield `const ${componentFunctionalVar} = __VLS_asFunctionalComponent(${componentOriginalVar}, new ${componentOriginalVar}({${utils_1.newLine}`;
|
|
160
158
|
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.checkUnknownProps, false);
|
|
161
159
|
yield `}))${utils_1.endOfLine}`;
|
|
162
160
|
yield `const `;
|
|
163
|
-
yield* (0,
|
|
161
|
+
yield* (0, wrapWith_1.wrapWith)(node.loc.start.offset, node.loc.end.offset, ctx.resolveCodeFeatures({
|
|
164
162
|
verification: {
|
|
165
163
|
shouldReport(_source, code) {
|
|
164
|
+
// https://typescript.tv/errors/#ts6133
|
|
166
165
|
return String(code) !== '6133';
|
|
167
166
|
},
|
|
168
167
|
}
|
|
169
|
-
}),
|
|
170
|
-
yield ` = ${
|
|
168
|
+
}), componentVNodeVar);
|
|
169
|
+
yield ` = ${componentFunctionalVar}`;
|
|
171
170
|
yield* generateComponentGeneric(ctx);
|
|
172
171
|
yield `(`;
|
|
173
|
-
yield* (0,
|
|
174
|
-
yield `, ...__VLS_functionalComponentArgsRest(${
|
|
172
|
+
yield* (0, wrapWith_1.wrapWith)(tagOffsets[0], tagOffsets[0] + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.checkUnknownProps, true, failedPropExps), `}`);
|
|
173
|
+
yield `, ...__VLS_functionalComponentArgsRest(${componentFunctionalVar}))${utils_1.endOfLine}`;
|
|
175
174
|
yield* generateFailedPropExps(options, ctx, failedPropExps);
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
yield* (0, elementEvents_1.generateElementEvents)(options, ctx, node, componentFunctionalVar, componentVNodeVar, componentCtxVar);
|
|
176
|
+
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
177
|
+
const [refName, offset] = yield* generateElementReference(options, ctx, node);
|
|
178
|
+
const tag = (0, shared_2.hyphenateTag)(node.tag);
|
|
179
|
+
const isRootNode = ctx.singleRootNodes.has(node) && !options.vueCompilerOptions.fallthroughComponentNames.includes(tag);
|
|
178
180
|
if (refName || isRootNode) {
|
|
179
|
-
const
|
|
181
|
+
const componentInstanceVar = ctx.getInternalVariable();
|
|
180
182
|
ctx.currentComponent.used = true;
|
|
181
|
-
yield `var ${
|
|
182
|
-
if (
|
|
183
|
-
&& node.codegenNode.props?.type === CompilerDOM.NodeTypes.JS_OBJECT_EXPRESSION
|
|
184
|
-
&& node.codegenNode.props.properties.some(({ key }) => key.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && key.content === 'ref_for')) {
|
|
183
|
+
yield `var ${componentInstanceVar} = {} as (Parameters<NonNullable<typeof ${componentCtxVar}['expose']>>[0] | null)`;
|
|
184
|
+
if (isVForChild) {
|
|
185
185
|
yield `[]`;
|
|
186
186
|
}
|
|
187
187
|
yield `${utils_1.endOfLine}`;
|
|
188
|
-
if (refName) {
|
|
189
|
-
ctx.templateRefs.set(refName,
|
|
188
|
+
if (refName && offset) {
|
|
189
|
+
ctx.templateRefs.set(refName, {
|
|
190
|
+
typeExp: `typeof ${ctx.getHoistVariable(componentInstanceVar)}`,
|
|
191
|
+
offset
|
|
192
|
+
});
|
|
190
193
|
}
|
|
191
194
|
if (isRootNode) {
|
|
192
|
-
ctx.
|
|
195
|
+
ctx.singleRootElTypes.push(`NonNullable<typeof ${componentInstanceVar}>['$el']`);
|
|
193
196
|
}
|
|
194
197
|
}
|
|
195
|
-
const usedComponentEventsVar = yield* (0, elementEvents_1.generateElementEvents)(options, ctx, node, var_functionalComponent, var_componentInstance, var_componentEvents);
|
|
196
|
-
if (usedComponentEventsVar) {
|
|
197
|
-
ctx.currentComponent.used = true;
|
|
198
|
-
yield `let ${var_componentEmit}!: typeof ${var_defineComponentCtx}.emit${utils_1.endOfLine}`;
|
|
199
|
-
yield `let ${var_componentEvents}!: __VLS_NormalizeEmits<typeof ${var_componentEmit}>${utils_1.endOfLine}`;
|
|
200
|
-
}
|
|
201
198
|
if (hasVBindAttrs(options, ctx, node)) {
|
|
202
199
|
const attrsVar = ctx.getInternalVariable();
|
|
200
|
+
yield `let ${attrsVar}!: Parameters<typeof ${componentFunctionalVar}>[0]${utils_1.endOfLine}`;
|
|
203
201
|
ctx.inheritedAttrVars.add(attrsVar);
|
|
204
|
-
yield `let ${attrsVar}!: Parameters<typeof ${var_functionalComponent}>[0];\n`;
|
|
205
202
|
}
|
|
203
|
+
(0, styleScopedClasses_1.collectStyleScopedClassReferences)(options, ctx, node);
|
|
206
204
|
const slotDir = node.props.find(p => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === 'slot');
|
|
207
205
|
if (slotDir) {
|
|
208
206
|
yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir);
|
|
209
207
|
}
|
|
210
208
|
else {
|
|
211
|
-
|
|
209
|
+
// #932: reference for default slot
|
|
210
|
+
yield* (0, vSlot_1.generateImplicitDefaultSlot)(ctx, node);
|
|
211
|
+
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
212
212
|
}
|
|
213
213
|
if (ctx.currentComponent.used) {
|
|
214
|
-
yield `var ${
|
|
214
|
+
yield `var ${componentCtxVar}!: __VLS_PickFunctionalComponentCtx<typeof ${componentOriginalVar}, typeof ${componentVNodeVar}>${utils_1.endOfLine}`;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
function* generateElement(options, ctx, node, isVForChild) {
|
|
@@ -227,23 +227,28 @@ function* generateElement(options, ctx, node, isVForChild) {
|
|
|
227
227
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, endTagOffset, ctx.codeFeatures.withoutHighlightAndCompletion);
|
|
228
228
|
}
|
|
229
229
|
yield `)(`;
|
|
230
|
-
yield* (0,
|
|
230
|
+
yield* (0, wrapWith_1.wrapWith)(startTagOffset, startTagOffset + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps, true, failedPropExps), `}`);
|
|
231
231
|
yield `)${utils_1.endOfLine}`;
|
|
232
232
|
yield* generateFailedPropExps(options, ctx, failedPropExps);
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
234
|
+
const [refName, offset] = yield* generateElementReference(options, ctx, node);
|
|
235
|
+
if (refName && offset) {
|
|
236
|
+
let typeExp = `__VLS_NativeElements['${node.tag}']`;
|
|
236
237
|
if (isVForChild) {
|
|
237
|
-
|
|
238
|
+
typeExp += `[]`;
|
|
238
239
|
}
|
|
239
|
-
ctx.templateRefs.set(refName,
|
|
240
|
+
ctx.templateRefs.set(refName, {
|
|
241
|
+
typeExp,
|
|
242
|
+
offset
|
|
243
|
+
});
|
|
240
244
|
}
|
|
241
|
-
if (ctx.
|
|
242
|
-
ctx.
|
|
245
|
+
if (ctx.singleRootNodes.has(node)) {
|
|
246
|
+
ctx.singleRootElTypes.push(`__VLS_NativeElements['${node.tag}']`);
|
|
243
247
|
}
|
|
244
248
|
if (hasVBindAttrs(options, ctx, node)) {
|
|
245
249
|
ctx.inheritedAttrVars.add(`__VLS_intrinsicElements.${node.tag}`);
|
|
246
250
|
}
|
|
251
|
+
(0, styleScopedClasses_1.collectStyleScopedClassReferences)(options, ctx, node);
|
|
247
252
|
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
248
253
|
}
|
|
249
254
|
function* generateFailedPropExps(options, ctx, failedPropExps) {
|
|
@@ -252,36 +257,8 @@ function* generateFailedPropExps(options, ctx, failedPropExps) {
|
|
|
252
257
|
yield utils_1.endOfLine;
|
|
253
258
|
}
|
|
254
259
|
}
|
|
255
|
-
function* generateVScope(options, ctx, node, props) {
|
|
256
|
-
const vScope = props.find(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && (prop.name === 'scope' || prop.name === 'data'));
|
|
257
|
-
let inScope = false;
|
|
258
|
-
let originalConditionsNum = ctx.blockConditions.length;
|
|
259
|
-
if (vScope?.type === CompilerDOM.NodeTypes.DIRECTIVE && vScope.exp) {
|
|
260
|
-
const scopeVar = ctx.getInternalVariable();
|
|
261
|
-
const condition = `__VLS_withScope(__VLS_ctx, ${scopeVar})`;
|
|
262
|
-
yield `const ${scopeVar} = `;
|
|
263
|
-
yield [
|
|
264
|
-
vScope.exp.loc.source,
|
|
265
|
-
'template',
|
|
266
|
-
vScope.exp.loc.start.offset,
|
|
267
|
-
ctx.codeFeatures.all,
|
|
268
|
-
];
|
|
269
|
-
yield utils_1.endOfLine;
|
|
270
|
-
yield `if (${condition}) {${utils_1.newLine}`;
|
|
271
|
-
ctx.blockConditions.push(condition);
|
|
272
|
-
inScope = true;
|
|
273
|
-
}
|
|
274
|
-
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
275
|
-
const [refName, offset] = yield* generateReferencesForElements(options, ctx, node); // <el ref="foo" />
|
|
276
|
-
(0, styleScopedClasses_1.collectStyleScopedClassReferences)(options, ctx, node);
|
|
277
|
-
if (inScope) {
|
|
278
|
-
yield `}${utils_1.newLine}`;
|
|
279
|
-
ctx.blockConditions.length = originalConditionsNum;
|
|
280
|
-
}
|
|
281
|
-
return [refName, offset];
|
|
282
|
-
}
|
|
283
260
|
function getCanonicalComponentName(tagText) {
|
|
284
|
-
return utils_1.
|
|
261
|
+
return utils_1.identifierRegex.test(tagText)
|
|
285
262
|
? tagText
|
|
286
263
|
: (0, shared_1.capitalize)((0, shared_1.camelize)(tagText.replace(colonReg, '-')));
|
|
287
264
|
}
|
|
@@ -299,17 +276,17 @@ function getPossibleOriginalComponentNames(tagText, deduplicate) {
|
|
|
299
276
|
return names;
|
|
300
277
|
}
|
|
301
278
|
function* generateCanonicalComponentName(tagText, offset, features) {
|
|
302
|
-
if (utils_1.
|
|
279
|
+
if (utils_1.identifierRegex.test(tagText)) {
|
|
303
280
|
yield [tagText, 'template', offset, features];
|
|
304
281
|
}
|
|
305
282
|
else {
|
|
306
|
-
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(tagText.replace(colonReg, '-')), offset, features);
|
|
283
|
+
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(tagText.replace(colonReg, '-')), 'template', offset, features);
|
|
307
284
|
}
|
|
308
285
|
}
|
|
309
286
|
function* generateComponentGeneric(ctx) {
|
|
310
287
|
if (ctx.lastGenericComment) {
|
|
311
288
|
const { content, offset } = ctx.lastGenericComment;
|
|
312
|
-
yield* (0,
|
|
289
|
+
yield* (0, wrapWith_1.wrapWith)(offset, offset + content.length, ctx.codeFeatures.verification, `<`, [
|
|
313
290
|
content,
|
|
314
291
|
'template',
|
|
315
292
|
offset,
|
|
@@ -318,17 +295,17 @@ function* generateComponentGeneric(ctx) {
|
|
|
318
295
|
}
|
|
319
296
|
ctx.lastGenericComment = undefined;
|
|
320
297
|
}
|
|
321
|
-
function*
|
|
298
|
+
function* generateElementReference(options, ctx, node) {
|
|
322
299
|
for (const prop of node.props) {
|
|
323
300
|
if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE
|
|
324
301
|
&& prop.name === 'ref'
|
|
325
302
|
&& prop.value) {
|
|
326
303
|
const [content, startOffset] = (0, utils_1.normalizeAttributeValue)(prop.value);
|
|
327
|
-
|
|
328
|
-
yield `/** @type {
|
|
304
|
+
// navigation support for `const foo = ref()`
|
|
305
|
+
yield `/** @type {typeof __VLS_ctx`;
|
|
329
306
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, content, startOffset, ctx.codeFeatures.navigation, prop.value.loc);
|
|
330
|
-
yield `
|
|
331
|
-
if (utils_1.
|
|
307
|
+
yield `} */${utils_1.endOfLine}`;
|
|
308
|
+
if (utils_1.identifierRegex.test(content) && !options.templateRefNames.has(content)) {
|
|
332
309
|
ctx.accessExternalVariable(content, startOffset);
|
|
333
310
|
}
|
|
334
311
|
return [content, startOffset];
|
|
@@ -337,7 +314,7 @@ function* generateReferencesForElements(options, ctx, node) {
|
|
|
337
314
|
return [];
|
|
338
315
|
}
|
|
339
316
|
function hasVBindAttrs(options, ctx, node) {
|
|
340
|
-
return options.vueCompilerOptions.fallthroughAttributes && (
|
|
317
|
+
return options.vueCompilerOptions.fallthroughAttributes && ((options.inheritAttrs && ctx.singleRootNodes.has(node)) ||
|
|
341
318
|
node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE
|
|
342
319
|
&& prop.name === 'bind'
|
|
343
320
|
&& prop.exp?.loc.source === '$attrs'));
|
|
@@ -2,4 +2,4 @@ import * as CompilerDOM from '@vue/compiler-dom';
|
|
|
2
2
|
import type { Code } from '../../types';
|
|
3
3
|
import type { TemplateCodegenContext } from './context';
|
|
4
4
|
import type { TemplateCodegenOptions } from './index';
|
|
5
|
-
export declare function generateElementChildren(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode
|
|
5
|
+
export declare function generateElementChildren(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode): Generator<Code>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateElementChildren = generateElementChildren;
|
|
4
|
-
const CompilerDOM = require("@vue/compiler-dom");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
4
|
const templateChild_1 = require("./templateChild");
|
|
7
|
-
function* generateElementChildren(options, ctx, node
|
|
5
|
+
function* generateElementChildren(options, ctx, node) {
|
|
8
6
|
yield* ctx.resetDirectiveComments('end of element children start');
|
|
9
7
|
let prev;
|
|
10
8
|
for (const childNode of node.children) {
|
|
@@ -12,15 +10,5 @@ function* generateElementChildren(options, ctx, node, isDefaultSlot = false) {
|
|
|
12
10
|
prev = childNode;
|
|
13
11
|
}
|
|
14
12
|
yield* ctx.generateAutoImportCompletion();
|
|
15
|
-
// fix https://github.com/vuejs/language-tools/issues/932
|
|
16
|
-
if (ctx.currentComponent
|
|
17
|
-
&& isDefaultSlot
|
|
18
|
-
&& node.children.length
|
|
19
|
-
&& node.tagType === CompilerDOM.ElementTypes.COMPONENT) {
|
|
20
|
-
ctx.currentComponent.used = true;
|
|
21
|
-
yield `${ctx.currentComponent.ctxVar}.slots!.`;
|
|
22
|
-
yield* (0, utils_1.wrapWith)(node.children[0].loc.start.offset, node.children[node.children.length - 1].loc.end.offset, ctx.codeFeatures.navigation, `default`);
|
|
23
|
-
yield utils_1.endOfLine;
|
|
24
|
-
}
|
|
25
13
|
}
|
|
26
14
|
//# sourceMappingURL=elementChildren.js.map
|
|
@@ -9,6 +9,8 @@ const codeFeatures_1 = require("../codeFeatures");
|
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
10
|
const camelized_1 = require("../utils/camelized");
|
|
11
11
|
const stringLiteralKey_1 = require("../utils/stringLiteralKey");
|
|
12
|
+
const wrapWith_1 = require("../utils/wrapWith");
|
|
13
|
+
const elementProps_1 = require("./elementProps");
|
|
12
14
|
const interpolation_1 = require("./interpolation");
|
|
13
15
|
const objectProperty_1 = require("./objectProperty");
|
|
14
16
|
const builtInDirectives = new Set([
|
|
@@ -31,13 +33,13 @@ function* generateElementDirectives(options, ctx, node) {
|
|
|
31
33
|
continue;
|
|
32
34
|
}
|
|
33
35
|
ctx.accessExternalVariable((0, shared_1.camelize)('v-' + prop.name), prop.loc.start.offset);
|
|
34
|
-
yield* (0,
|
|
36
|
+
yield* (0, wrapWith_1.wrapWith)(prop.loc.start.offset, prop.loc.end.offset, ctx.codeFeatures.verification, `__VLS_asFunctionalDirective(`, ...generateIdentifier(options, ctx, prop), `)(null!, { ...__VLS_directiveBindingRestFields, `, ...generateArg(options, ctx, prop), ...generateModifiers(options, ctx, prop), ...generateValue(options, ctx, prop), ` }, null!, null!)`);
|
|
35
37
|
yield utils_1.endOfLine;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
function* generateIdentifier(options, ctx, prop) {
|
|
39
41
|
const rawName = 'v-' + prop.name;
|
|
40
|
-
yield* (0,
|
|
42
|
+
yield* (0, wrapWith_1.wrapWith)(prop.loc.start.offset, prop.loc.start.offset + rawName.length, ctx.codeFeatures.verification, `__VLS_directives.`, ...(0, camelized_1.generateCamelized)(rawName, 'template', prop.loc.start.offset, ctx.resolveCodeFeatures({
|
|
41
43
|
...codeFeatures_1.codeFeatures.withoutHighlight,
|
|
42
44
|
// fix https://github.com/vuejs/language-tools/issues/1905
|
|
43
45
|
...codeFeatures_1.codeFeatures.additionalCompletion,
|
|
@@ -54,7 +56,7 @@ function* generateArg(options, ctx, prop) {
|
|
|
54
56
|
return;
|
|
55
57
|
}
|
|
56
58
|
const startOffset = arg.loc.start.offset + arg.loc.source.indexOf(arg.content);
|
|
57
|
-
yield* (0,
|
|
59
|
+
yield* (0, wrapWith_1.wrapWith)(startOffset, startOffset + arg.content.length, ctx.codeFeatures.verification, `arg`);
|
|
58
60
|
yield `: `;
|
|
59
61
|
if (arg.isStatic) {
|
|
60
62
|
yield* (0, stringLiteralKey_1.generateStringLiteralKey)(arg.content, startOffset, ctx.codeFeatures.all);
|
|
@@ -71,7 +73,7 @@ function* generateModifiers(options, ctx, prop, propertyName = 'modifiers') {
|
|
|
71
73
|
}
|
|
72
74
|
const startOffset = modifiers[0].loc.start.offset - 1;
|
|
73
75
|
const endOffset = modifiers.at(-1).loc.end.offset;
|
|
74
|
-
yield* (0,
|
|
76
|
+
yield* (0, wrapWith_1.wrapWith)(startOffset, endOffset, ctx.codeFeatures.verification, propertyName);
|
|
75
77
|
yield `: { `;
|
|
76
78
|
for (const mod of modifiers) {
|
|
77
79
|
yield* (0, objectProperty_1.generateObjectProperty)(options, ctx, mod.content, mod.loc.start.offset, ctx.codeFeatures.withoutHighlightAndNavigation);
|
|
@@ -84,9 +86,9 @@ function* generateValue(options, ctx, prop) {
|
|
|
84
86
|
if (exp?.type !== CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
85
87
|
return;
|
|
86
88
|
}
|
|
87
|
-
yield* (0,
|
|
89
|
+
yield* (0, wrapWith_1.wrapWith)(exp.loc.start.offset, exp.loc.end.offset, ctx.codeFeatures.verification, `value`);
|
|
88
90
|
yield `: `;
|
|
89
|
-
yield* (0,
|
|
91
|
+
yield* (0, elementProps_1.generatePropExp)(options, ctx, prop, exp, ctx.codeFeatures.all);
|
|
90
92
|
}
|
|
91
93
|
function getPropRenameApply(oldName) {
|
|
92
94
|
return oldName === (0, shared_2.hyphenateAttr)(oldName) ? shared_2.hyphenateAttr : undefined;
|
|
@@ -3,7 +3,8 @@ import type * as ts from 'typescript';
|
|
|
3
3
|
import type { Code } from '../../types';
|
|
4
4
|
import type { TemplateCodegenContext } from './context';
|
|
5
5
|
import type { TemplateCodegenOptions } from './index';
|
|
6
|
-
export declare function generateElementEvents(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode,
|
|
6
|
+
export declare function generateElementEvents(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode, componentFunctionalVar: string, componentVNodeVar: string, componentCtxVar: string): Generator<Code>;
|
|
7
7
|
export declare function generateEventArg(ctx: TemplateCodegenContext, name: string, start: number, directive?: string): Generator<Code>;
|
|
8
8
|
export declare function generateEventExpression(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, prop: CompilerDOM.DirectiveNode): Generator<Code>;
|
|
9
|
+
export declare function generateModelEventExpression(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, prop: CompilerDOM.DirectiveNode): Generator<Code>;
|
|
9
10
|
export declare function isCompoundExpression(ts: typeof import('typescript'), ast: ts.SourceFile): boolean;
|
|
@@ -3,73 +3,87 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateElementEvents = generateElementEvents;
|
|
4
4
|
exports.generateEventArg = generateEventArg;
|
|
5
5
|
exports.generateEventExpression = generateEventExpression;
|
|
6
|
+
exports.generateModelEventExpression = generateModelEventExpression;
|
|
6
7
|
exports.isCompoundExpression = isCompoundExpression;
|
|
7
8
|
const CompilerDOM = require("@vue/compiler-dom");
|
|
8
9
|
const shared_1 = require("@vue/shared");
|
|
9
10
|
const utils_1 = require("../utils");
|
|
10
11
|
const camelized_1 = require("../utils/camelized");
|
|
12
|
+
const wrapWith_1 = require("../utils/wrapWith");
|
|
11
13
|
const interpolation_1 = require("./interpolation");
|
|
12
|
-
function* generateElementEvents(options, ctx, node,
|
|
13
|
-
let
|
|
14
|
+
function* generateElementEvents(options, ctx, node, componentFunctionalVar, componentVNodeVar, componentCtxVar) {
|
|
15
|
+
let emitVar;
|
|
16
|
+
let eventsVar;
|
|
14
17
|
let propsVar;
|
|
15
18
|
for (const prop of node.props) {
|
|
16
19
|
if (prop.type === CompilerDOM.NodeTypes.DIRECTIVE
|
|
17
|
-
&& prop.name === 'on'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
&& (prop.name === 'on' && (prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic)
|
|
21
|
+
|| prop.name === 'model' && (!prop.arg || prop.arg.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic))) {
|
|
22
|
+
ctx.currentComponent.used = true;
|
|
23
|
+
if (!emitVar) {
|
|
24
|
+
emitVar = ctx.getInternalVariable();
|
|
25
|
+
eventsVar = ctx.getInternalVariable();
|
|
23
26
|
propsVar = ctx.getInternalVariable();
|
|
24
|
-
yield `let ${
|
|
27
|
+
yield `let ${emitVar}!: typeof ${componentCtxVar}.emit${utils_1.endOfLine}`;
|
|
28
|
+
yield `let ${eventsVar}!: __VLS_NormalizeEmits<typeof ${emitVar}>${utils_1.endOfLine}`;
|
|
29
|
+
yield `let ${propsVar}!: __VLS_FunctionalComponentProps<typeof ${componentFunctionalVar}, typeof ${componentVNodeVar}>${utils_1.endOfLine}`;
|
|
25
30
|
}
|
|
26
|
-
let source = prop.arg
|
|
27
|
-
let start = prop.arg
|
|
28
|
-
let propPrefix = 'on';
|
|
31
|
+
let source = prop.arg?.loc.source ?? 'model-value';
|
|
32
|
+
let start = prop.arg?.loc.start.offset;
|
|
33
|
+
let propPrefix = 'on-';
|
|
29
34
|
let emitPrefix = '';
|
|
30
|
-
if (
|
|
35
|
+
if (prop.name === 'model') {
|
|
36
|
+
propPrefix = 'onUpdate:';
|
|
37
|
+
emitPrefix = 'update:';
|
|
38
|
+
}
|
|
39
|
+
else if (source.startsWith('vue:')) {
|
|
31
40
|
source = source.slice('vue:'.length);
|
|
32
41
|
start = start + 'vue:'.length;
|
|
33
|
-
propPrefix = 'onVnode';
|
|
42
|
+
propPrefix = 'onVnode-';
|
|
34
43
|
emitPrefix = 'vnode-';
|
|
35
44
|
}
|
|
36
|
-
yield `
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
yield `(): __VLS_NormalizeComponentEvent<typeof ${propsVar}, typeof ${eventsVar}, '${(0, shared_1.camelize)(propPrefix + source)}', '${emitPrefix + source}', '${(0, shared_1.camelize)(emitPrefix + source)}'> => ({${utils_1.newLine}`;
|
|
46
|
+
if (prop.name === 'on') {
|
|
47
|
+
yield* generateEventArg(ctx, source, start, propPrefix.slice(0, -1));
|
|
48
|
+
yield `: `;
|
|
49
|
+
yield* generateEventExpression(options, ctx, prop);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
yield `'${(0, shared_1.camelize)(propPrefix + source)}': `;
|
|
53
|
+
yield* generateModelEventExpression(options, ctx, prop);
|
|
54
|
+
}
|
|
55
|
+
yield `})${utils_1.endOfLine}`;
|
|
41
56
|
}
|
|
42
57
|
}
|
|
43
|
-
return usedComponentEventsVar;
|
|
44
58
|
}
|
|
45
59
|
function* generateEventArg(ctx, name, start, directive = 'on') {
|
|
46
60
|
const features = {
|
|
47
61
|
...ctx.codeFeatures.withoutHighlightAndCompletion,
|
|
48
62
|
...ctx.codeFeatures.navigationWithoutRename,
|
|
49
63
|
};
|
|
50
|
-
if (utils_1.
|
|
64
|
+
if (utils_1.identifierRegex.test((0, shared_1.camelize)(name))) {
|
|
51
65
|
yield ['', 'template', start, features];
|
|
52
66
|
yield directive;
|
|
53
|
-
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(name), start, utils_1.combineLastMapping);
|
|
67
|
+
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(name), 'template', start, utils_1.combineLastMapping);
|
|
54
68
|
}
|
|
55
69
|
else {
|
|
56
|
-
yield* (0,
|
|
70
|
+
yield* (0, wrapWith_1.wrapWith)(start, start + name.length, features, `'`, directive, ...(0, camelized_1.generateCamelized)((0, shared_1.capitalize)(name), 'template', start, utils_1.combineLastMapping), `'`);
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
73
|
function* generateEventExpression(options, ctx, prop) {
|
|
60
74
|
if (prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
61
|
-
let prefix =
|
|
62
|
-
let suffix =
|
|
75
|
+
let prefix = `(`;
|
|
76
|
+
let suffix = `)`;
|
|
63
77
|
let isFirstMapping = true;
|
|
64
78
|
const ast = (0, utils_1.createTsAst)(options.ts, prop.exp, prop.exp.content);
|
|
65
79
|
const _isCompoundExpression = isCompoundExpression(options.ts, ast);
|
|
66
80
|
if (_isCompoundExpression) {
|
|
67
81
|
yield `(...[$event]) => {${utils_1.newLine}`;
|
|
68
82
|
ctx.addLocalVariable('$event');
|
|
69
|
-
prefix =
|
|
70
|
-
suffix =
|
|
83
|
+
prefix = ``;
|
|
84
|
+
suffix = ``;
|
|
71
85
|
for (const blockCondition of ctx.blockConditions) {
|
|
72
|
-
prefix += `if (
|
|
86
|
+
prefix += `if (!${blockCondition}) return${utils_1.endOfLine}`;
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
89
|
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', offset => {
|
|
@@ -101,6 +115,16 @@ function* generateEventExpression(options, ctx, prop) {
|
|
|
101
115
|
yield `() => {}`;
|
|
102
116
|
}
|
|
103
117
|
}
|
|
118
|
+
function* generateModelEventExpression(options, ctx, prop) {
|
|
119
|
+
if (prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
120
|
+
yield `(...[$event]) => (`;
|
|
121
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.verification, prop.exp.content, prop.exp.loc.start.offset, prop.exp.loc);
|
|
122
|
+
yield ` = $event)`;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
yield `() => {}`;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
104
128
|
function isCompoundExpression(ts, ast) {
|
|
105
129
|
let result = true;
|
|
106
130
|
if (ast.statements.length === 0) {
|
|
@@ -8,4 +8,4 @@ export interface FailedPropExpression {
|
|
|
8
8
|
suffix: string;
|
|
9
9
|
}
|
|
10
10
|
export declare function generateElementProps(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode, props: CompilerDOM.ElementNode['props'], strictPropsCheck: boolean, enableCodeFeatures: boolean, failedPropExps?: FailedPropExpression[]): Generator<Code>;
|
|
11
|
-
export declare function generatePropExp(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, prop: CompilerDOM.DirectiveNode, exp: CompilerDOM.SimpleExpressionNode | undefined, features: VueCodeInformation, enableCodeFeatures
|
|
11
|
+
export declare function generatePropExp(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, prop: CompilerDOM.DirectiveNode, exp: CompilerDOM.SimpleExpressionNode | undefined, features: VueCodeInformation, enableCodeFeatures?: boolean): Generator<Code>;
|