Laravel livewire未定义类型'Livewire\组件'

dxpyg8gm  于 2023-01-31  发布在  其他
关注(0)|答案(1)|浏览(128)

在我用livewire
composer require livewire/livewire
并使用创建新的livewire component

php artisan make:livewire search

我一直收到错误Undefined type 'Livewire\Component'

<?php

namespace App\Http\Livewire;

use Livewire\Component;

class Search extends Component
{
    public function render()
    {
        return view('livewire.search');
    }
}
?>

你能帮帮我吗我到底做错了什么

afdcj2ne

afdcj2ne1#

如文档(https://laravel-livewire.com/docs/2.x/quickstart)中所述:
使用以下命令将livewire导入布局:

...
    @livewireStyles
</head>
<body>
    ...
 
    @livewireScripts
</body>
</html>

https://laravel-livewire.com/

相关问题