问题:
Vue启动项目后Network: unavailable;
解决方法:
需在项目的根目录(package-lock.json文件的目录)配置vue.config.js文件,在vue.config.js里写以下代码:
module.exports = {
configureWebpack: {
// other webpack options to merge in ...
},
// devServer Options don't belong into `configureWebpack`
devServer: {
host: 'localhost',
port: '8081',
hot: true,
public: 'localhost:8081',//主要代码
disableHostCheck: true,
},
};
配置后: