vue.js怎么改端口号


本文摘自PHP中文网,作者coldplay.xixi,侵删。

vue.js更改端口号的方法:1、config文件夹中有一个【index.js】其中部分内容如下,port即为端口号,在这里更改;2、【Vue 3.x】中修改端口号则需要在项目根目录下创建一个【vue.config.js】。

本教程操作环境:windows10系统、vue2.9,本文适用于所有品牌的电脑。

【相关文章推荐:vue.js】

vue.js更改端口号的方法:

1.Vue 2.x

config文件夹中有一个index.js其中部分内容如下,port即为端口号,在这里更改即可。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

module.exports = {

  dev: {

    env: require('./dev.env'),

    port: 8080,  // 端口号

    assetsSubDirectory: 'static',

    assetsPublicPath: '/',

    proxyTable: {},

    // CSS Sourcemaps off by default because relative paths are "buggy"

    // with this option, according to the CSS-Loader README

    // (https://github.com/webpack/css-loader#sourcemaps)

    // In our experience, they generally work as expected,

    // just be aware of this issue when enabling this option.

    cssSourceMap: false,

   }

};

2.Vue 3.x

阅读剩余部分

相关阅读 >>

vue.js如何带参数跳转

vue.js有什么特点

vue.js的ul-li标签仿select标签

vue.js如何判断输入是否是数字

vue.js中如何运行项目

render函数生成图片弹窗的代码示例

vue.js怎么用swiper

vue.js怎么改端口号

使用vue.js实现图像裁剪功能

vue.js插槽有什么用

更多相关阅读请进入《vue.js》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...