Просмотр исходного кода

polish(compiler): remove the extra space of v-for alias (#8233)

yongningfu 7 лет назад
Родитель
Сommit
038ed86967
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/compiler/parser/index.js

+ 1 - 1
src/compiler/parser/index.js

@@ -375,7 +375,7 @@ export function parseFor (exp: string): ?ForParseResult {
   const alias = inMatch[1].trim().replace(stripParensRE, '')
   const iteratorMatch = alias.match(forIteratorRE)
   if (iteratorMatch) {
-    res.alias = alias.replace(forIteratorRE, '')
+    res.alias = alias.replace(forIteratorRE, '').trim()
     res.iterator1 = iteratorMatch[1].trim()
     if (iteratorMatch[2]) {
       res.iterator2 = iteratorMatch[2].trim()