在vue.config.js中,修改配置:disableHostCheck: true,
module.exports = {
devServer: {
open: true,
host:"batman.com",
port: 27202,
https: false,
disableHostCheck: true,
...
},
...
}
本文介绍如何在vue.config.js中配置disableHostCheck为true, 以允许跨域访问。具体包括设置devServer的open、host、port、https等属性。
在vue.config.js中,修改配置:disableHostCheck: true,
module.exports = {
devServer: {
open: true,
host:"batman.com",
port: 27202,
https: false,
disableHostCheck: true,
...
},
...
}

被折叠的 条评论
为什么被折叠?