看了半天就是页面不显示预期的数据,检查结果是自己的方法写错了,少写了一个括号
before:
created(){
this.fetchData()
cityApi.getList.then(response=>{
this.cityList=response.data
})
after:
created(){
this.fetchData()
cityApi.getList().then(response=>{
this.cityList=response.data
})