yzyh

当前需要使用的组件:

 1 import data from \'./test.json\'
 2   export default{
 3     data(){
 4       return{
 5         userinform: \'\'
 6       }
 7     },
 8 mounted(){
 9   this.userinform = data
10   }
11 }

test.json就是普通json格式就可以了!然后完美解决!

 

后台服务器请求json方式:

1   this.$http.get(\'url\').then(response => {
2     //succces callback
3 
4     var data = response.body;
5   }, response => {
6     // error callback
7     alert(\'连接失败!\')
8   });

 如需交流可加博主QQ:602697966(备注博客园)

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案