码迷,mamicode.com
首页 > 其他好文 > 详细

相对路径 绝对路径

时间:2018-06-03 10:44:12      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:.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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!