绝对路径



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: '请求数据出错'
});
});


 


作者:孟繁贵