Skip to content

Commit 99d012d

Browse files
committed
Fix slot name
1 parent 6e3bddd commit 99d012d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ protected function handleNamedSlotsInclude(DOMNode $node, Component $usedCompone
13311331
if ($childNode instanceof DOMElement && $childNode->tagName === 'template') {
13321332
foreach ($childNode->attributes as $attribute) {
13331333
if ($attribute instanceof DOMAttr && preg_match('/v-slot(?::([a-z0-9_-]+)?)/i', $attribute->nodeName, $matches)) {
1334-
$slotName = $matches[1] ?? Slot::SLOT_DEFAULT_NAME;
1334+
$slotName = $matches[1] ? str_replace('-', '_', $matches[1]) : Slot::SLOT_DEFAULT_NAME;
13351335
$this->addSlot($slotName, $childNode, $usedComponent);
13361336
$removeNodes[] = $childNode;
13371337
}

0 commit comments

Comments
 (0)