伙计们,我在使用laravel面包屑制作不同的url图标时遇到了麻烦,这里是图片
我要使图标HRMS和仪表板不同
这是我的刀片文件
<link rel="stylesheet" type="text/css" href="{{ asset("/css/hrms2.css") }}">
@if (count($breadcrumbs))
<ol class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if ($breadcrumb->url && !$loop->last)
<li class="breadcrumb-item" style="">
<a class="bread-color" href="{{ $breadcrumb->url }}">
<i class="fa fa-home"></i> {{ $breadcrumb->title }}</a>
</li>
@else
<li class="breadcrumb-item active">{{ $breadcrumb->title }}</li>
@endif
@endforeach
</ol>
@endif
答案 0 :(得分:1)
您还需要在$breadcrumb
对象中传递图标名称,并使用$breadcrumb->icon
代替fa-home
<ol class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if ($breadcrumb->url && !$loop->last)
<li class="breadcrumb-item" style=""><a class="bread-color" href="{{ $breadcrumb->url }}"> <i class="fa {{ $breadcrumb->icon }}"></i> {{ $breadcrumb->title }}</a></li>
@else
<li class="breadcrumb-item active">{{ $breadcrumb->title }}</li>
@endif
@endforeach