您好,欢迎来到华佗小知识。
搜索
您的当前位置:首页vue3项目中无法实现cpolar内网穿透解决方案

vue3项目中无法实现cpolar内网穿透解决方案

来源:华佗小知识

运行vue3,打开cpolar启动内网穿透,结果却发现

在vue.config.js中修改为如下代码:

const { defineConfig } = require('@vue/cli-service');

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    allowedHosts: 'all',
    host: '0.0.0.0',
    port: 8080,
    https: false,  // 确保使用 HTTP
    client: {
      webSocketURL: {
        protocol: 'ws',
        hostname: 'localhost',
        port: 8080
      }
    }
  }
});

大功告成!

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- huatuo0.cn 版权所有 湘ICP备2023017654号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务