Skip to content

Commit be7d37c

Browse files
author
Jordan Hoff
committed
Components should have one root element
1 parent ba37ca2 commit be7d37c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/VueDirective.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class VueDirective
1111
*/
1212
public static function end() : string
1313
{
14-
return '<?php echo \Jhoff\BladeVue\Component::end(); ?>';
14+
return '</div><?php echo \Jhoff\BladeVue\Component::end(); ?>';
1515
}
1616

1717
/**
@@ -22,6 +22,6 @@ public static function end() : string
2222
*/
2323
public static function start(string $expression) : string
2424
{
25-
return "<?php echo \Jhoff\BladeVue\Component::start($expression); ?>";
25+
return "<?php echo \Jhoff\BladeVue\Component::start($expression); ?><div>";
2626
}
2727
}

tests/Unit/VueDirectiveTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function startDirectiveReturnsCorrectPhpBlock()
1616
$code = VueDirective::start('"component", ["foo" => "bar"]');
1717

1818
$this->assertEquals(
19-
'<?php echo \Jhoff\BladeVue\Component::start("component", ["foo" => "bar"]); ?>',
19+
'<?php echo \Jhoff\BladeVue\Component::start("component", ["foo" => "bar"]); ?><div>',
2020
$code
2121
);
2222
}
@@ -29,7 +29,7 @@ public function endDirectiveReturnsCorrectPhpBlock()
2929
$code = VueDirective::end();
3030

3131
$this->assertEquals(
32-
'<?php echo \Jhoff\BladeVue\Component::end(); ?>',
32+
'</div><?php echo \Jhoff\BladeVue\Component::end(); ?>',
3333
$code
3434
);
3535
}

0 commit comments

Comments
 (0)