1

我想使用 livewire 从 url "example.com/user?type=agent" 获取类型的值。

我尝试使用 Input::get('type') 但在 livewire 组件类中不起作用

4

3 回答 3

1

我使用文档查询字符串让它工作

于 2021-01-23T09:38:20.517 回答
-1

我不知道livewire,但它看起来像laravel。试试看嘛

Input::query('type')
于 2021-01-23T08:12:16.077 回答
-1

你可以做:

HTTP 请求

use Illuminate\Http\Request;

$type = $request->input('type');

助手请求方法

$type = request('type');
于 2021-01-23T09:36:53.987 回答