laravel - 在 VueJS 和 Laravel 中使用 Axios 响应后无法访问 InertiaJS 道具
问题描述
在 VueJS 中使用 Axios 发出下一个请求
axios.post('route-of-the-method'), {
data,
}).then((res) => {
self.$vs.notification({
title: this.$page.props.language.section.success,
text: this.$page.props.language.section.action_done,
});
...
然后控制器的响应是下一个:
return response()->json(true);
所以看起来很简单,它应该正确启动通知,但它崩溃了,因为 vue 无法从惯性读取阴影道具。
我正在执行 Axios 请求而不是惯性请求,因为我正在与另一个应用程序共享该方法。
解决方案
推荐阅读
- c# - WPF 设置单元格填充折叠 DataGrid 的列
- angular - 从 Outlook 日历 API 获取 oauth2 代码
- sql - 将输出拆分到 Hive 中的多个文件
- c++ - 为什么我的 ListBox 中仍然有字符串,即使在使用循环单独删除它们之后?
- unit-testing - 软件测试中“正确性”一词的意义是什么?
- amazon-web-services - 如何使用 terraform 为我的 EC2 实例获取默认 CIDR 块?
- c++ - 在整数之后获取多个字符串输入?
- arrays - 根据值给出排名
- c# - XDocument 在一行中写入特定的 XElement
- reactjs - TypeError: date[("get" + method)] 不是 React-big-calendar 中的函数