我尝试从 livewire 组件传递一个变量:
class Index extends Component
{
public function render()
{
return view('livewire.index')->with('type', config('constants.NONAUTH'));
}
}
并从 layouts.app 访问它:
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
{{dd($type)}}
@include('includes.head')
...
我收到一个$type
未定义的错误,这样做的正确方法是什么?