第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

axios如何將mock數(shù)據(jù)改為用api數(shù)據(jù)的url獲取真實(shí)數(shù)據(jù)呢?

axios如何將mock數(shù)據(jù)改為用api數(shù)據(jù)的url獲取真實(shí)數(shù)據(jù)呢?

Ajinglalala 2017-08-04 15:40:33
user.jsconst Users = [{?for (let i = 0; i < 86; i++) {? Users.push(Mock.mock({??? id: Mock.Random.guid(),??? name: Mock.Random.cname(),??? addr: Mock.mock('@county(true)'),??? 'age|18-60': 1,??? birth: Mock.Random.date(),??? sex: Mock.Random.integer(0, 1)? }));}]}export { LoginUsers, Users, Informations };user.vueexport default {??data() {???return {????filters: {????? _id: ''????},??????? loading: false,????informations: []???}??},??created() {??????????? axios.get('informations')???????????????? .then(response => {???????????????????? this.informations = response.data???????????????? })???????????????? .catch(e => {???????????????????? this.errors.push(e)???????????????? })??????? }
查看完整描述

1 回答

?
林逸舟丶

TA貢獻(xiàn)124條經(jīng)驗(yàn) 獲得超28個(gè)贊

把get括號(hào)中對(duì)應(yīng)的地址改為接口地址,通過(guò)打印接收到的response,拿到data里面需要的字段,并賦給組件中的data。

查看完整回答
反對(duì) 回復(fù) 2018-01-09
  • 1 回答
  • 2 關(guān)注
  • 4844 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)