问答详情
源自:4-3 联系人列表

老师,我这个为啥没打印出来res?提示304

<template>

<div>

<!-- 联系人列表 -->

<van-contact-list

:list="list"

@add="onAdd"

@edit="onEdit"

/>

</div>

</template>


<script>

import {ContactList} from 'vant'

import axios from 'axios';


export default {

name: 'contactList',

components: {

[ContactList.name]: ContactList

},

data() {

return {

list: [],

instance: null  //axios实例

}

},

create() {

this.instance = axios.create({

baseURL: 'http://localhost:9000/api',

timeout: 1000

})

this.instance.get('/contactList')

.then(res =>{

console.log(res)

// this.list = res.data.data

})

},

methods: {

//添加联系人

onAdd() {


},

//编辑联系人

onEdit() {


}

}

}

</script>


https://img4.mukewang.com/5d63d9b70001b16323681516.jpg

提问者:小章鱼丸 2019-08-26 21:08

个回答

  • 小章鱼丸
    2019-08-26 21:15:17

    - -知道了 created少写了