fix(compiler-core): support ts syntax in expressions when isTS is true

This commit is contained in:
Evan You 2021-09-20 11:51:01 -04:00
parent e9c0694451
commit 0dc521b9e1

View File

@ -85,6 +85,14 @@ export function baseCompile(
const ast = isString(template) ? baseParse(template, options) : template
const [nodeTransforms, directiveTransforms] =
getBaseTransformPreset(prefixIdentifiers)
if (!__BROWSER__ && options.isTS) {
const { expressionPlugins } = options
if (!expressionPlugins || !expressionPlugins.includes('typescript')) {
options.expressionPlugins = [...(expressionPlugins || []), 'typescript']
}
}
transform(
ast,
extend({}, options, {