In Laravle 7,
in the output of the common display by the component.
There will be extra spaces before and after the component display.
app/Views/Components/SiteTitle.php
class SiteTitle extensions Component
{
public$title;
/**
* Create a new component instance.
*
* @return void
*/
public function__construct()
{
$this->title='Title';
}
/**
* Get the view/contents that present the component.
*
* @return\Illuminate\View\View|string
*/
public function render()
{
return view('components.site-title');
}
}
resources/views/components/site-title.blade.php
{{$title}}
displaying blade
<title><x-site-title/></title>
Simplified but
in the x-site-title portion in this configuration
I'd like you to mark it as a title.
<title>Title>/title>
A blank space appears before and after the title, as shown in .
Does anyone know this solution?
laravel
It didn't solve this problem, so I was able to implement similar functions with a helper, so I dealt with it.
© 2024 OneMinuteCode. All rights reserved.