.net6.0 制作 element-plus 离线文档 附下载地址

下载地址:

 Elementplus.Offline.exe · JohnnyL/tuku - 码云 - 开源中国 (gitee.com)

https: //gitee.com/xyyhqq/gallery/blob/master/Elementplus.Offline.exe

  

1、新建net6.0 webapi 项目

设置配置信息

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
      <!--重要配置-->
      <GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
  </PropertyGroup>

  <ItemGroup>
      <!--重要配置-->
      <EmbeddedResource Include="wwwroot\**" />
  </ItemGroup>

  <ItemGroup>
    <None Include="wwwroot\.idea\.gitignore" />
    <None Include="wwwroot\.idea\dist.iml" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.17" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
    
  </ItemGroup>

  <ItemGroup>
      
    <Folder Include="Properties\PublishProfiles\" />
  </ItemGroup> 
</Project>

 

将elementplus文档放入wwwroot文件夹中

 

 

 

安装nuget包

Microsoft.Extensions.FileProviders.Embedded

配置 FileProvider 

   app.UseFileServer(new FileServerOptions
            {
                FileProvider = new ManifestEmbeddedFileProvider(typeof(Program).Assembly, "wwwroot")

            });

 

 发布

 

 

 

 

 

 

 

 

 双击打开

 

 

 

 

 访问

http://localhost:5000 就可以看到elementplus离线文档了

 

 

 文件下载地址:

Elementplus.Offline.exe · JohnnyL/tuku - 码云 - 开源中国 (gitee.com)

 

 

 

posted @ 2023-04-02 17:43  JohnnyLei  阅读(837)  评论(0)    收藏  举报