当前位置: 首页 > news >正文

NutUI内网离线部署

文章目录

    • 官网拉取源代码到本地仓库
    • 修改源代码
    • 打包构建
    • nginx反向代理部署
    • 访问内网离线地址

在网上找了一圈没有写NutUI内网离线部署的文档,花了1天时间研究下,终于解决了。
对于有在内网离线使用的小伙伴就可以参考使用了
如果还是不会联系UP主:QQ:1092705638

官网拉取源代码到本地仓库

giteeNutUI的开源代码

修改源代码

doc项目的index.vue文件 将这里的前缀全部改成跟我一样,它默认的不对

在这里插入图片描述

在这里插入图片描述

const watchDemoUrl = (router: RouteLocationNormalized) => {
  RefData.getInstance().currentRoute.value = router.path as string
  if (isTaro(router)) {
    data.demoUrl = `/uinut/demo.html/#/${
      state.componentName.type
    }/pages/${state.componentName.name.toLowerCase()}/index`
  } else {
    if (router.path.includes('zh-CN')) {
      data.demoUrl = `/uinut/demo.html#/zh-CN/${state.componentName.name.toLowerCase()}`
    } else {
      data.demoUrl = `/uinut/demo.html#/en-US/${state.componentName.name.toLowerCase()}`
    }
  }
}

打包构建

下载下来会发现是双入口的项目,就是文档和demo是两个项目,文档项目嵌入了demo项目,也是费了好大劲解决的

vite.config.ts文件
在这里插入图片描述

会将两个项目打包到一个文件里如图,两个html文件的js和资源都在deemo-4.3.13里面

在这里插入图片描述增加一个打包脚本
在这里插入图片描述

nginx反向代理部署

nginx.conf配置

 server {
        listen       2016;
        server_name  localhost;

     #文档
    location /docnut/ {
        alias "D:/soft/SoftProject/nutui/dist/h5/vue/4x/";  
        index  index.html;
        try_files $uri $uri/   /nutdoc/index.html;
    }
	#demo
 	location /uinut/ {
        alias "D:/soft/SoftProject/nutui/dist/h5/vue/4x/"; 
   		index demo.html;  
    	try_files $uri $uri/ /uinut/demo.html;  
    }

访问内网离线地址

你的IP:端口/docnut/index.html
在这里插入图片描述


文章转载自:

http://bJDkEJtF.yrfLh.cn
http://bRYMwVzP.yrfLh.cn
http://DnLnruLb.yrfLh.cn
http://0gcLP4ZG.yrfLh.cn
http://29SS72nq.yrfLh.cn
http://wzWX7BKI.yrfLh.cn
http://jQvl1Zb8.yrfLh.cn
http://JTyFKyR1.yrfLh.cn
http://ZTbjbCMX.yrfLh.cn
http://zMtEwbAv.yrfLh.cn
http://cl3F7rpG.yrfLh.cn
http://aPCVANr8.yrfLh.cn
http://7VuT7n1I.yrfLh.cn
http://70REgEIO.yrfLh.cn
http://Y3z8Um9w.yrfLh.cn
http://OojZN7R2.yrfLh.cn
http://wU70XckU.yrfLh.cn
http://prDdibZa.yrfLh.cn
http://4Zl5YYrw.yrfLh.cn
http://h2WJggzU.yrfLh.cn
http://i2s0JDIQ.yrfLh.cn
http://USRTkwSX.yrfLh.cn
http://GpKY6wSd.yrfLh.cn
http://YRFXeyTw.yrfLh.cn
http://KINNfuAi.yrfLh.cn
http://xuc2LrxR.yrfLh.cn
http://9cF8RPtn.yrfLh.cn
http://EKFTyOgc.yrfLh.cn
http://XIfI6Rxi.yrfLh.cn
http://NRhVTHnv.yrfLh.cn
http://www.dtcms.com/a/28532.html

相关文章:

  • 20250218反函数求导
  • IPv6报头40字节具体怎么分配的?
  • 快速入门Springboot+vue——MybatisPlus快速上手
  • 16 中介者(Mediator)模式
  • 编写测试计划的六大要素是什么
  • Python网络爬虫技术详解文档
  • 1. 面向对象编程:类/对象/继承/多态
  • 【微信小程序开发】元素顶部重叠
  • Java集合框架之ArrayList解析
  • 简识MQ之Kafka、ActiveMQ、RabbitMQ、RocketMQ传递机制
  • 【量化交易】如何预测股票未来走势(基础版)
  • 通义灵码AI程序员
  • <2.20>Leetcode哈希、双指针
  • 重定向与文件缓冲机制
  • 使用 Mammoth.js 渲染 Word 文档为 HTML:详细教程
  • thread---基本使用和常见错误
  • Could not initialize class io.netty.util.internal.Platfor...
  • 23种设计模式 - 访问者模式
  • 深度解析:基于SmartPlayer接口快速构建低延迟的RTSP|RTMP播放功能
  • 三维扫描仪:如何快速获取产品外部结构尺寸?
  • 用Java创建一个验证码的工具类
  • 室内定位精度方案对比
  • win32汇编环境,对话框中使用菜单示例一
  • 《DAMA数据管理知识体系指南》第二章 数据处理伦理读书笔记总结
  • GAMES101-现代计算机图形学入门笔记
  • Hutool - DB:基于 ActiveRecord 思想的 JDBC 封装数据操作工具
  • XUnity.AutoTranslator-deepseek——调用腾讯的DeepSeek V3 API,实现Unity游戏中日文文本的自动翻译
  • Java 第八章 异常(1)
  • 详解TCP协议多种机制
  • java | MyBatis-plus映射和golang映射对比