从后台查询出一条信息对象,前台声明一个对象结收,类似后台接收前台JSON对象一样,然后通过${{对象.属性获取值}}
-
vue中声明接收对象
image.png
-
接收
image.png
-
js
image.png
---vue
//mounted
mounted() {
this.getInfo()
},
methods: {
// unitID 路由过来
getInfo() {
// 参数:this.$route.query.unitID
getCompanyInfo(1).then(res => {
// 分页总数
// this.total = res.data.total;
console.log(res.data);
this.companyInfo = res.data
// 数据使用
// this.tableData = res.data.records
// 二次发送数据获取管理人员信息
// 关闭加载状态
this.loading = false;
});
}
},
---js
/获取企业基本信息/
export function getInfoById(id) {
return request({
url: /unit/company/${id}
,
method: 'get',
})
}
网友评论