用途:该技能覆盖 AdonisJS + Inertia 项目的 Vue 3 前端层,后端模式需配合 adonisjs 技能使用。
主要能力与用法: 组件导入:始终从 @adonisjs/inertia/vue 导入 Form、Link,而非 @inertiajs/vue3,以保留路由名支持。 页面类型:类型在开发服务器运行时由 Transformer 自动生成,无需手动命令;从 @generated/data 导入 Data,默认形状用 Data.Post[],变体形状用 Data.Post.Variants['forDetailedView']。 共享数据:通过 usePage<SharedProps>() 访问 user、flash、errors;共享逻辑写在 app/middleware/inertia_middleware.ts 的 InertiaMiddleware.share(),而非 start/inertia.ts,且需用 ctx.inertia.always() 以在部分重载中保留。 Form:method 与 action 由路由名推断,不传 method/action;多表单用 errorBag 隔离错误。 Link:内部导航用 route 属性;查询参数用 urlFor + :href,不用 route 属性;DELETE 等方法可指定 method 与 as。 数据加载:控制器侧可用 inertia.always、inertia.defer、inertia.optional、merge;Vue 侧用 Deferred 组件消费延迟属性。 分页:使用 posts.metadata 的 total、perPage、currentPage、lastPage、firstPage,配合 urlFor 生成翻页链接。 重定向与历史:response.redirect().toRoute() 标准重定向;inertia.location() 外部跳转;inertia.clearHistory() 清历史;inertia.encryptHistory() 加密敏感页面历史。
限制:资料未提供安装命令、版本要求、收费或平台信息;具体配置、SSR 与根模板细节见 references/inertia.md,设置流程见 runbooks/inertia.md。