相对路径 绝对路径

绝对路径

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: '请求数据出错'
        });
            });
原文地址:https://www.cnblogs.com/mengfangui/p/9127749.html