laravel - 我错过了什么吗,this.form.fill() 似乎对我不起作用
问题描述
我的用户控制器功能:
public function profile()
{
return auth('api')->user();
}
我正在开发带有 vue 的前端和带有 laravel 的后端的项目。
我的 Vue.js 代码:
import Form from 'vform';
export default {
data () {
return {
form: new Form({
id:'',
name: '',
email: '',
password: '',
type:'',
bio:'',
photo:''
})
}
},
mounted() {
console.log('Component mounted.')
},
created(){
axios.get("api/profile")
.then( ({data}) => (this.form.fill(data)))
}
}
我尝试以表格形式显示数据,但是当我调用此函数时,它不会返回数据。我做错了什么?我知道这个函数 this.form.fill(data) 有问题,但我不知道实际的问题是什么。
解决方案
推荐阅读
- python - 打开遥控机器人键盘时出现错误
- python - diff match patch python vs diff match patch c++ stl
- powershell - Powershell foreach 循环从 .csv 文件中查询用户的 AD
- python - 为并行进程提供共享只读资源
- django - 每次 websocket 连接处于活动状态并且自动重载由 watchman 触发时,Uvicorn 都会关闭
- deployment - 如何跳过欢迎页面并直接从 /admin(登录)页面启动 Strapi?
- arrays - 如何让 typescript 在以数组为目标的代理中对 set 方法感到满意?
- ios - About using Swiftz library issues(Functional programing)
- api - shopware 6 上传多个产品变体图像
- python - 硒简单问题