【问题标题】:InvalidArgumentException View [layouts.app] not found. Larave-8 LliveWire-2未找到 InvalidArgumentException 视图 [layouts.app]。 Laravel-8 LiveWire-2
【发布时间】:2021-07-02 12:07:31
【问题描述】:

当我将 app.blade.php 更改为 base.blade.php 时,出现以下错误。

InvalidArgumentException 查看 [layouts.app] 未找到。 (查看:D:\Code\my-app\vendor\livewire\livewire\src\Macros\livewire-view-component.blade.php)

layouts.app 未找到。
你是说 layouts\base 吗?

否则,效果很好。

-这是我的代码。
资源\视图\布局\base.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
    <title>Document</title>
    @livewireStyles
</head>
<body>
    @livewire('auth.register')
    
    @livewireScripts
</body>
</html>

资源\视图\livewire\auth\register.blade.php

<div>
    Registration Form
</div>

web.php

<?php

use App\Http\Livewire\Auth\Register;
use Illuminate\Support\Facades\Route;


Route::get('/register', Register::class);

app\Http\Livewire\Auth\Register.php

<?php

namespace App\Http\Livewire\Auth;

use Livewire\Component;

class Register extends Component
{
 public function render()
    {
        return view('livewire.auth.register');
    }
}

注意:app.blade.php 仍然有效

【问题讨论】:

    标签: php laravel laravel-8 laravel-livewire


    【解决方案1】:

    您必须搜索引用最后一个 app.blade.php 源的任何内容。在某些情况下,刀片是从主组件延伸出来的,所以刀片可能具有指令@extends('layout.app') 并且需要很好地引用

    【讨论】:

      猜你喜欢
      • 2021-09-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-24
      相关资源
      最近更新 更多