我不明白为什么内容在没有浏览器的情况下不可见。
index.blade.php
<!DOCTYPE html>
<html>
<head>
<title>Teste</title>
</head>
<body>
@yield('content')
</body>
</html>
conteudo.blade.php
@extends('index')
@section('content')
<p>This is my body content.</p>
@endsection
routes.php
Route::get('index', function() {
return view('layouts/index');
});
Route::get('blade', function() {
return view('layouts/conteudo');
});
试试这个:
请更改您的conteudo.blade.php
代码
@extends('index')
@section('content')
<p>This is my body content.</p>
@endsection
至
@extends('layouts.index')
@section('content')
<p>This is my body content.</p>
@endsection
希望这对你有帮助。