标签:.data 路径 info 绝对路径 .json code axios.get 数据 get
绝对路径
axios.get(‘/static/modelplat/menuCon.json‘).then(res => {
this.menuCon = res.data.menuCon;
// 初始化数据
this.sceneModelCon = this.menuCon[0].modelArr;
}).catch(() => {
this.$message({
type: ‘info‘,
message: ‘请求数据出错‘
});
});
相对路径:
axios.get(‘./static/modelplat/menuCon.json‘).then(res => {
this.menuCon = res.data.menuCon;
// 初始化数据
this.sceneModelCon = this.menuCon[0].modelArr;
}).catch(() => {
this.$message({
type: ‘info‘,
message: ‘请求数据出错‘
});
});
axios.get(‘static/modelplat/menuCon.json‘).then(res => {
this.menuCon = res.data.menuCon;
// 初始化数据
this.sceneModelCon = this.menuCon[0].modelArr;
}).catch(() => {
this.$message({
type: ‘info‘,
message: ‘请求数据出错‘
});
});
标签:.data 路径 info 绝对路径 .json code axios.get 数据 get
原文地址:https://www.cnblogs.com/mengfangui/p/9127749.html