]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
feat(compiler-vapor/v-bind): globally allowed
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Sat, 9 Dec 2023 15:25:01 +0000 (23:25 +0800)
committer三咲智子 Kevin Deng <sxzz@sxzz.moe>
Sat, 9 Dec 2023 15:29:22 +0000 (23:29 +0800)
packages/compiler-vapor/src/generate.ts

index 4bce56044d561aa359ea2d0f411886aa4cbc541a..b7ac40de7ff32a2b98f533e8b180286b5630cd7d 100644 (file)
@@ -30,7 +30,7 @@ import {
   IRNodeTypes,
 } from './ir'
 import { SourceMapGenerator } from 'source-map-js'
-import { camelize, isString, makeMap } from '@vue/shared'
+import { camelize, isGloballyAllowed, isString, makeMap } from '@vue/shared'
 import type { Identifier } from '@babel/types'
 
 // remove when stable
@@ -534,6 +534,7 @@ function genExpression(node: IRExpression, context: CodegenContext): void {
     !node.content.trim() ||
     // there was a parsing error
     ast === false ||
+    isGloballyAllowed(rawExpr) ||
     isLiteralWhitelisted(rawExpr)
   ) {
     return push(rawExpr, NewlineType.None, loc)