Evan You 10 лет назад
Родитель
Сommit
b225de7fec
2 измененных файлов с 5 добавлено и 3 удалено
  1. 3 3
      src/compiler/codegen/index.js
  2. 2 0
      src/compiler/parser/index.js

+ 3 - 3
src/compiler/codegen/index.js

@@ -71,9 +71,9 @@ function genData (el) {
   if (el.key) {
     data += `key:${el.key},`
   }
-  // slot names
-  if (el.attrsMap.slot) {
-    data += `slot:"${el.attrsMap.slot}",`
+  // slot target
+  if (el.slotTarget) {
+    data += `slot:${el.slotTarget},`
   }
   // class
   if (el.staticClass) {

+ 2 - 0
src/compiler/parser/index.js

@@ -270,6 +270,8 @@ function processRender (el) {
 function processSlot (el) {
   if (el.tag === 'slot') {
     el.slotName = getBindingAttr(el, 'name')
+  } else {
+    el.slotTarget = getBindingAttr(el, 'slot')
   }
 }