昨天的问题是
modules: [
'@nuxtjs/axios',
],这个后面 还有一个
modules: [],
没删, 不要直接加,要在后面添, 不然覆盖了,to thi tha
modules: [
'@nuxtjs/axios',
],
axios: {
prefix: '/api/',
proxy: true // Can be also an object with default options
},
proxy: {
'/api/': { target: 'http://localhost:3089', pathRewrite: {'^/api/': ''} }
},
nuxt 要下载的是
@nuxtjs/axios包,---
"dependencies": {
"@nuxtjs/axios": "^5.5.2",