admin 发表于 2019-8-9 09:39:13

Vue webpack 本地IP无法访问解决方法



找到配置文件 index JS 将 localhost改为 0.0.0.0 即可, ipconfig得到本机IP,加上端口号即可访问

// Various Dev Server settings
    host: 'localhost', // can be overwritten by process.env.HOST
    port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
    autoOpenBrowser: false,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-


页: [1]
查看完整版本: Vue webpack 本地IP无法访问解决方法