當前需要使用的組件:
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 });

