You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Laravel新视图无法继承home_layout.blade.php布局求助

问题描述

我在大学项目中使用home_layout.blade.php作为其他视图的布局模板,此前运行正常。但新建视图并使用@extends('pharmacy.home_layout')继承布局后,页面未加载布局样式,仅显示内容部分。其他视图继承该布局正常,新建文件测试仍出现相同问题。

代码示例
@extends('pharmacy.home_layout')
@section('content')

<article class="wow fadeIn animated hover-up mb-30 animated">
    <!-- Post Thumbnail -->
    <div class="post-thumb" style="background-image: url('{{ asset('storage/' . $item->up_image) }}');">
        <div class="entry-meta">
            <a class='entry-meta meta-2' href='/blog-category-grid'></a>
        </div>
    </div>

    <!-- Post Content -->
    <div class="entry-content-2 pl-50">
        <!-- Post Title -->
        <h3 class="post-title mb-20">
            <a href='/blog-post-right'>{{$item->up_name}}</a>
        </h3>

        <!-- Trade Name -->
        <h5> اسم المنتج التجاري</h5>
        <p class="post-exerpt mb-40">{{$item->up_trade_name}}</p>

        <!-- Description -->
        <h5> الوصف</h5>
        <p class="post-exerpt mb-40">{{$item->description}}</p>

        <!-- Meta Information -->
        <div class="entry-meta meta-1 font-xs color-grey mt-10 pb-10"> 
            <div>
                <span class="post-on">{{$item->up_publish_date}}</span>
            </div>   
        </div>
    </div>
</article>

@endsection
效果对比
  • 无布局效果:无布局效果截图
  • 正常布局效果:正常布局效果截图

内容的提问来源于stack exchange,提问作者Mohimen

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 22:22:45