vue2.0 在手机上面调试

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/flycompany/article/details/83591848

vue2.0 在手机上面调试

打开项目config目录

修改index.js

module.exports = {
  dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},

    // Various Dev Server settings
    host: '0.0.0.0', // 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,

修改host为0.0.0.0, 重启项目.

最后查看电脑ip,手机浏览器输入电脑ip加上端口号即可,需要注意的是手机和电脑在同一局域网内。

猜你喜欢

转载自blog.csdn.net/flycompany/article/details/83591848