laravel-arcanist / inertia-response-renderer
Arcanist 的 Inertia 响应渲染器
0.6.0
2022-07-14 04:23 UTC
Requires
- php: ^8.0
- inertiajs/inertia-laravel: ^0.5.2
- laravel-arcanist/arcanist: ^0.7.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.13
- mockery/mockery: ^1.4
- orchestra/testbench: ^6.17 || ^7.6
- phpunit/phpunit: ^9.0
- roave/security-advisories: dev-master
README
此包提供了 Arcanist 的 Inertia.js 响应渲染器。
真正的文档仍在编写中,但这里有一个非常快速的了解。
安装
通过 composer 安装包(你仍然需要安装主 Arcanist 包)。
composer require laravel-arcanist/inertia-response-renderer
在 config/arcanist.php
中,将 renderers.renderer
键更改为 Arcanist\InertiaResponseRenderer::class
。
就这样。
工作原理
响应渲染器将尝试通过以下约定解析步骤模板
resources/js/Pages/Wizards/{wizard-slug}/{step-slug}.vue
您可以通过更改配置中的 renderers.inertia.component_base_path
设置来配置 Wizard
路径前缀。
视图数据
Arcanist 将 step
和 wizard
属性传递给所有视图。这些可以通过常规 Inertia 方式访问。
this.$page.props.arcanist.wizard this.$page.props.arcanist.step
有关这些变量的更详细说明,请参阅 主要文档。