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)???????????????? })??????? }
axios如何將mock數(shù)據(jù)改為用api數(shù)據(jù)的url獲取真實(shí)數(shù)據(jù)呢?
Ajinglalala
2017-08-04 15:40:33