swagger 生成接口文档,并导出html和pdf的过程

2023-10-31

swagger 生成接口文档,并导出html和pdf的过程

swagger 生成接口文档

1.springboot版本:

 <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.3.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

2.导入swagger相关的依赖:

 <dependency>
     <groupId>com.github.xiaoymin</groupId>
     <artifactId>swagger-bootstrap-ui</artifactId>
     <version>1.9.5</version>
 </dependency>

<!-- swagger的依赖 -->
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.6.1</version>
</dependency>

3.API

package com.example.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.util.ArrayList;
import java.util.List;

/**
 * 蓝色界面
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
	/**
	 * @Description 构建API基本信息
	 * @Param []
	 * @return springfox.documentation.service.ApiInfo
	 **/
	private ApiInfo buildApiInfo() {
		return new ApiInfoBuilder()
				.title("接口说明文档")
				.description("说明文档简介")
				.contact("sunrj")
				.version("1.0")
				.build();
	}

	@Bean
	public Docket docket() {
		/*
		 *  全局配置信息(可以不用)例如:token
		 */
		Parameter token = new ParameterBuilder().name("token")
				.description("用户令牌")
				.parameterType("header")
				.modelRef(new ModelRef("String"))
				.build();
		List<Parameter> parameters = new ArrayList<>();
		parameters.add(token);
		
		return new Docket(DocumentationType.SWAGGER_2)
				.globalOperationParameters(parameters)  //传入全局配置
				.apiInfo(buildApiInfo())  //传入api首页信息
				.select() //进行筛选
				//通过package筛选,
				.apis(RequestHandlerSelectors.basePackage("com.example.controller"))
				//构建api
				.build();
	}

}

3.controller
这里swagger的参数不做任何介绍,具体参数意思的大家自行百度

@RestController
@RequestMapping(value = "user", produces = MediaType.APPLICATION_JSON_VALUE)
@Api(value = "用户信息管理", tags ={"UserController"}, description = "用户基本信息操作API", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public class UserController {

    @Autowired
    private UserService userService;

    @Ignore
    @RequestMapping(value = "loginUser",method = RequestMethod.POST )
    @ApiOperation(value = "/loginUser", notes="通过用户名密码验证是否登陆成功")
    //@ApiImplicitParam(paramType="query", name = "user", value = "登录的用户名和密码信息", required = true, dataType = "User")
    public ResponseServer loginUser(User user){
        return userService.loginUser(user);
    }


    /**
     * 查询当前用户拥有的问卷调查列表
     * @return
     */
    //@RequestMapping("queryUserSurveyList")
    @RequestMapping(value = "queryUserSurveyList",method = RequestMethod.POST )
    @ApiOperation(value = "/queryUserSurveyList", notes="查询当前用户拥有的问卷调查列表")
    public ResponseServer queryUserSurveyList(User userSel){
        return userService.queryUserSurveyList(userSel.getName());
    }

    @RequestMapping(value = "queryUserAll",method = RequestMethod.GET )
    @ApiOperation(value = "/queryUserAll", notes="查询所有用户")
    public ResponseServer queryUserAll(){
        return userService.queryUserAll();
    }

    @RequestMapping(value = "insertUser",method =RequestMethod.POST )
    @ApiOperation(value = "/insertUser", notes="增加用户")
    public ResponseServer insertUser(@RequestBody User user){
        return userService.insertUser(user);
    }


    @ApiOperation(value = "/deleteUser", notes="通过id删除用户信息")
    @RequestMapping(value = "deleteUser",method =RequestMethod.DELETE )
    @ApiImplicitParam(paramType="query", name = "userId", value = "删除的用户Id", required = true, dataType = "int")
    public ResponseServer deleteUser( Integer userId){
        return userService.deleteUser(userId);
    }


    @ApiOperation(value = "/updateUser", notes="通过id修改用户信息")
    @RequestMapping(value = "updateUser",method =RequestMethod.PUT )
    public ResponseServer updateUser(@RequestBody User user){
        return userService.updateUser(user);
    }
}

4.model

package com.example.model;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@ApiModel(value="User", description = "用户的实体对象")
@AllArgsConstructor
@NoArgsConstructor
@Data
@TableName("t_user")
public class User {

    //@ApiModelProperty(value="userId" ,required=false)
    @TableId(value = "user_id", type = IdType.AUTO)
    @TableField(value = "user_id", exist = true)
    private Integer userId;

   // @ApiModelProperty(value="name" ,required=false)
    @TableField(value = "user_name", exist = true)
    private String name;

   // @ApiModelProperty(value="password" ,required=false)
    @TableField(value = "user_password", exist = true)
    private String password;


}

然后就成功了,启动程序:
访问:
http://localhost:8080/doc.html
成功:
在这里插入图片描述

还有另外一种页面,这里swagger的管理UI页面的依赖需要改成这个:

   <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.7.0</version>
        </dependency>
        

访问路径:
http://localhost:8088/swagger-ui.html
在这里插入图片描述

就可以了

swagger导出pdf和html

其实很简单,就是修改测试类,和配置文件
1.测试类

package com.example;


import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse;
import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import org.junit.After;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.restdocs.AutoConfigureRestDocs;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;

import io.github.robwin.markup.builder.MarkupLanguage;
import io.github.robwin.swagger2markup.GroupBy;
import io.github.robwin.swagger2markup.Swagger2MarkupConverter;
import springfox.documentation.staticdocs.SwaggerResultHandler;

@AutoConfigureMockMvc
@AutoConfigureRestDocs(outputDir = "target/generated-snippets")
@RunWith(SpringRunner.class)
@SpringBootTest
public class WeikangDemoApplicationTests {

    private String snippetDir = "target/generated-snippets";
    private String outputDir = "target/asciidoc";

    @Autowired
    private MockMvc mockMvc;

    @After
    public void Test() throws Exception {
        // 得到swagger.json,写入outputDir目录中
        mockMvc.perform(get("/v2/api-docs").accept(MediaType.APPLICATION_JSON))
                .andDo(SwaggerResultHandler.outputDirectory(outputDir).build()).andExpect(status().isOk()).andReturn();

        // 读取上一步生成的swagger.json转成asciiDoc,写入到outputDir
        // 这个outputDir必须和插件里面<generated></generated>标签配置一致
        Swagger2MarkupConverter.from(outputDir + "/swagger.json").withPathsGroupedBy(GroupBy.TAGS)// 按tag排序
                .withMarkupLanguage(MarkupLanguage.ASCIIDOC)// 格式
                .withExamples(snippetDir).build().intoFolder(outputDir);// 输出
    }


    /**
     *
     * Description: 一定要有测试方法,调用方法不限制
     *
     * @param
     * @return void
     * @throws
     * @Author lkf
     * Create Date: 2020年9月27日 下午4:46:11
     */
    @Test
    public void TestApi() throws Exception {

        mockMvc.perform(get("/user/queryUserAll").accept(MediaType.APPLICATION_JSON))
                .andExpect(status().isOk())
                .andDo(MockMvcRestDocumentation.document("queryUserAll", preprocessResponse(prettyPrint())));

    }


}

2.配置文件

<properties>
        <java.version>1.8</java.version>

        <!--swgger2markup 配置信息-->
        <asciidoctor.input.directory>${project.basedir}/docs/asciidoc</asciidoctor.input.directory>
        <generated.asciidoc.directory>${project.build.directory}/asciidoc</generated.asciidoc.directory>
        <asciidoctor.html.output.directory>${project.build.directory}/asciidoc/html</asciidoctor.html.output.directory>
        <asciidoctor.pdf.output.directory>${project.build.directory}/asciidoc/pdf</asciidoctor.pdf.output.directory>

    </properties>
  <!--离线文档-->
        <dependency>
            <groupId>org.springframework.restdocs</groupId>
            <artifactId>spring-restdocs-mockmvc</artifactId>
            <scope>test</scope>
        </dependency>

        <!--springfox-staticdocs 生成静态文档-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-staticdocs</artifactId>
            <version>2.6.1</version>
            <scope>test</scope>
        </dependency>
<build>
        <finalName>springboot_swagger</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <!--<plugin>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-maven-plugin</artifactId>
           </plugin>-->
            <!--Maven通过Maven Surefire Plugin插件执行单元测试-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>
            <!--通过Asciidoctor使得asciidoc生成其他的文档格式,例如:PDF 或者HTML5-->
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>1.5.3</version>
                <!--生成PDF-->
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>1.5.0-alpha.14</version>
                    </dependency>
                    <!-- Comment this section to use the default jruby artifact provided by the plugin -->
                    <dependency>
                        <groupId>org.jruby</groupId>
                        <artifactId>jruby-complete</artifactId>
                        <version>1.7.21</version>
                    </dependency>
                </dependencies>

                <!--文档生成配置-->
                <configuration>
                    <sourceDirectory>${asciidoctor.input.directory}</sourceDirectory>
                    <sourceDocumentName>index.adoc</sourceDocumentName>
                    <attributes>
                        <doctype>book</doctype>
                        <toc>left</toc>
                        <toclevels>3</toclevels>
                        <numbered></numbered>
                        <hardbreaks></hardbreaks>
                        <sectlinks></sectlinks>
                        <sectanchors></sectanchors>
                        <generated>${generated.asciidoc.directory}</generated>
                    </attributes>
                </configuration>
                <!--因为每次执行只能处理一个后端,所以对于每个想要的输出类型,都是独立分开执行-->
                <executions>
                    <!--html5-->
                    <execution>
                        <id>output-html</id>
                        <phase>test</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                            <outputDirectory>${asciidoctor.html.output.directory}</outputDirectory>
                        </configuration>
                    </execution>
                    <!--pdf-->
                    <execution>
                        <id>output-pdf</id>
                        <phase>test</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <outputDirectory>${asciidoctor.pdf.output.directory}</outputDirectory>

                            <!--解决中文乱码以及中文丢失问题-->
                            <attributes>
                                <toc>left</toc>
                                <toclevels>3</toclevels>
                                <numbered></numbered>
                                <hardbreaks></hardbreaks>
                                <sectlinks></sectlinks>
                                <sectanchors></sectanchors>
                                <generated>${generated.asciidoc.directory}</generated>
                                <pdf-fontsdir>fonts</pdf-fontsdir>
                                <pdf-stylesdir>themes</pdf-stylesdir>
                                <pdf-style>cn</pdf-style>
                            </attributes>

                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>


    </build>

解决乱码问题:

我这里上springboot 2.1.3.RELEASE的版本
解决方案:

一、

一种是下载字体(RobotoMono 开头和 KaiGenGothicCN 开头的字体文件)和theme文件(Source code (zip))。

字体下载链接:https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic/releases

然后在项目的资源目录下创建fonts和themes两个目录,把下载的8个字体文件复制到fonts目录下,解压asciidoctor-pdf-cjk-kai_gen_gothic-0.1.0-fonts.zip文件,把data\themes\下的cn-theme.yml复制到themes目录下

pom.xml配置,
如图:

在这里插入图片描述
这样就可以解决,网上还有别的方式。大家可以按照自己的版本解决

执行:
1.先执行测试类
2.命令 mvn clean test
在这里插入图片描述
然后就生成了:
在这里插入图片描述
具体需要什么文档,大家按需求进行配置即可
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

swagger 生成接口文档,并导出html和pdf的过程 的相关文章

  • 运行具有外部依赖项的 Scala 脚本

    我在 Users joe scala lib 下有以下 jar commons codec 1 4 jar httpclient 4 1 1 jar httpcore 4 1 jar commons logging 1 1 1 jar ht
  • JavaFX 中具有自定义内容的 ListView

    How i can make custom ListView with JavaFx for my app I need HBox with image and 2 Labels for each line listView 您可以通过查看
  • 按第一列排序二维数组,然后按第二列排序

    int arrs 1 100 11 22 1 11 2 12 Arrays sort arrs a b gt a 0 b 0 上面的数组已排序为 1 100 1 11 2 12 11 22 我希望它们按以下方式排序a 0 b 0 首先 如果
  • Java 8 流 - 合并共享相同 ID 的对象集合

    我有一系列发票 class Invoice int month BigDecimal amount 我想合并这些发票 这样我每个月都会收到一张发票 金额是本月发票金额的总和 例如 invoice 1 month 1 amount 1000
  • 如何在模态打开时防止主体滚动

    我在用着W3schools 模态脚本 https www w3schools com howto tryit asp filename tryhow css modal我想添加一个功能 防止模型打开时整个主体滚动 我根据我的需要对原始脚本做
  • Java 中的“Lambdifying”scala 函数

    使用Java和Apache Spark 已用Scala重写 面对旧的API方法 org apache spark rdd JdbcRDD构造函数 其参数为 AbstractFunction1 abstract class AbstractF
  • 很好地处理数据库约束错误

    再一次 它应该很简单 我的任务是在我们的应用程序的域对象中放置一个具有唯一约束的特定字段 这本身并不是一个很大的挑战 我刚刚做了以下事情 public class Location more fields Column unique tru
  • 普罗米修斯指标 - 未找到

    我有 Spring Boot 应用程序 并且正在使用 vertx 我想监控服务和 jvm 为此我选择了 Prometheus 这是我的监控配置类 Configuration public class MonitoringConfig Bea
  • 以编程方式在java的resources/source文件夹中创建文件?

    我有两个资源文件夹 src 这是我的 java 文件 资源 这是我的资源文件 图像 properties 组织在文件夹 包 中 有没有办法以编程方式在该资源文件夹中添加另一个 properties 文件 我尝试过这样的事情 public s
  • 在游戏视图下添加 admob

    我一直试图将 admob 放在我的游戏视图下 这是我的代码 public class HoodStarGame extends AndroidApplication Override public void onCreate Bundle
  • react-native run-android 失败并出现错误:任务 ':app:dexDebug' 执行失败

    我使用的是 Windows 8 1 和react native cli 1 0 0 and react native 0 31 0 添加后react native maps对于该项目 我运行了命令react native upgrade并给
  • 欧洲中部时间 14 日 3 月 30 日星期五 00:00:00 至 日/月/年

    我尝试解析格式日期Fri Mar 30 00 00 00 CET 14至 日 月 年 这是我的代码 SimpleDateFormat formatter new SimpleDateFormat dd MM yyyy System out
  • 在 Spring 中重构这个的最佳方法?

    private final ExecutorService executorParsers Executors newFixedThreadPool 10 public void parse List
  • 测试弱引用

    在 Java 中测试弱引用的正确方法是什么 我最初的想法是执行以下操作 public class WeakReferenceTest public class Target private String value public Targe
  • Netty:阻止调用以获取连接的服务器通道?

    呼吁ServerBootstrap bind 返回一个Channel但这不是在Connected状态 因此不能用于写入客户端 Netty 文档中的所有示例都显示写入Channel从它的ChannelHandler的事件如channelCon
  • 具有特定参数的 Spring AOP 切入点

    我需要创建一个我觉得很难描述的方面 所以让我指出一下想法 com x y 包 或任何子包 中的任何方法 一个方法参数是接口 javax portlet PortletRequest 的实现 该方法中可能有更多参数 它们可以是任何顺序 我需要
  • 为什么C++代码执行速度比java慢?

    我最近用 Java 编写了一个计算密集型算法 然后将其翻译为 C 令我惊讶的是 C 的执行速度要慢得多 我现在已经编写了一个更短的 Java 测试程序和一个相应的 C 程序 见下文 我的原始代码具有大量数组访问功能 测试代码也是如此 C 的
  • FileOutputStream.close() 中的设备 ioctl 不合适

    我有一些代码可以使用以下命令将一些首选项保存到文件中FileOutputStream 这是我已经写了一千遍的标准代码 FileOutputStream out new FileOutputStream file try BufferedOu
  • 调整添加的绘制组件的大小和奇怪的摆动行为

    这个问题困扰了我好几天 我正在制作一个特殊的绘画程序 我制作了一个 JPanel 并添加了使用 Paint 方法绘制的自定义 jComponent 问题是 每当我调整窗口大小时 所有添加的组件都会 消失 或者只是不绘制 因此我最终会得到一个
  • GUI Java 程序 - 绘图程序

    我一直试图找出我的代码有什么问题 这个想法是创建一个小的 Paint 程序并具有红色 绿色 蓝色和透明按钮 我拥有我能想到的让它工作的一切 但无法弄清楚代码有什么问题 该程序打开 然后立即关闭 import java awt import

随机推荐

  • 通过bigMap工具获取地图上各地方的经纬度范围

    首先去官网下载bigMap工具 地址 http www bigemap com reader download 下载成功点击软件 我们会出现这个页面 然后接下来就是选择区域了 相对应上面的操作之后 我们点击箭头 把我们的这个区域下载下来 格
  • 物联网设备的标识技术:RFID与NFC究竟有什么关系?

    物联网主要由三个方面关键技术 连接 标识以及数据的操作 之前 我们已经谈了很多关于物联网中物体如何连接网络的技术 而实际上物体的标识才是物联网实现的第一步 就是我们要唯一地标识和区分每一个物体 以RFID为代表的物体标识技术曾经几乎就是物联
  • YAML 基础知识

    目录 1 基本语法 2 数据类型 3 YAML 对象 4 YAML 数组 5 YAML 复合结构 6 YAML 纯量 7 引用 1 基本语法 1 大小写敏感 2 缩进表示层级关系 3 缩进只允许空格 不能使用tab 4 缩进空格数没有要求
  • torch报错

    报错1 RuntimeError ProcessGroupNCCL is only supported with GPUs no GPUs found 1 测试GPU是否可用 import torch 测试GPU是否可用 flag torc
  • 【mcuclub】PM2.5粉尘浓度检测模块GP2Y10

    一 实物图 二 原理图 编号 名称 功能 1 L VCC LED灯正极 2 L GND LED灯负极 3 LED LED灯引脚 4 S GND 模块负极 5 OUT 模拟量输出引脚 6 VCC 模块正极 L VCC引脚接电阻是用来限流 接电
  • Docker的概述与部署

    文章目录 一 Docker概述 1 1 什么是容器 1 2 Docker是什么 1 3 Docker的设计宗旨 1 4 Docker与虚拟机的区别 1 5 Docker的特点 1 6 Docker三要素 核心概念 1 7 Docker运行过
  • print输出

    作者 小刘在C站 每天分享课堂笔记 一起努力 共赴美好人生 夕阳下 是最美的 绽放 目录 一 print输出函数 二 print函数输出 一 print输出函数 def print self args sep end n file None
  • 查看系统是否安装了ftp服务器,在openEuler系统中搭建FTP服务器:使用和配置vsftpd的方法...

    本文教您在openEuler操作系统中搭建FTP服务器 介绍使用vsftpd 安装vsftpd 管理vsftpd服务 配置vsftpd vsftpd配置文件介绍 默认配置说明 配置本地时间 配置欢迎信息 配置系统帐号登录权限 验证FTP服务
  • node.js+vue的爱心助农电商管理系统

    技术架构 nodejs vue 功能模块 登录登出模块 农产品信息是每个用户独立存在的 因此用户需要进行登录查看以及操作后台系统 应考虑到用户管理问题 暂没有开放用户注册模块 新用户注册可以联系数据库管理员进行录入 用户在此界面模块需要进行
  • 从键盘输入某班学生某门课的成绩(每班人数最多不超过40人),当输入为负值时,表示输入结束,试编程将分数按从高到低顺序进行排序输出。

    排序功能需要自定义函数实现 输入格式要求 d 输入提示信息 Input score Total students are d n Sorted scores 输出格式要求 4d 程序的运行示例如下 Input score 84 Input
  • 【Express.js】健康检查

    健康检查 许多时候 我们需要对应用进行监控 来获取他的详细状态 这节介绍几个在 express 中进行健康检查的方案 亲自手写 亲自创建一些路由 根据情况返回应用的相关信息 不过自己写比较麻烦 除非有特别的需求 一般我们就用第三方的解决方案
  • Ubuntu18.04系统备份与恢复软件推荐——Systemback

    Ubuntu18 04备份与恢复软件推荐 systemback 推荐理由 systemback简介 systemback的安装 systemback的使用 1 打开与关闭 2 系统备份 还原 参考相关 操作系统 Ubuntu18 04 5
  • Linux手动释放缓存的方法

    一 Linux释放内存的相关知识介绍 在Linux系统下 我们一般不需要去释放内存 因为系统已经将内存管理的很好 但是凡事也有例外 有的时候内存会被缓存占用掉 导致系统使用SWAP空间影响性能 例如当你在Linux下频繁存取文件后 物理内存
  • 关系型数据库的设计思想,20张图给你看的明明白白

    本文介绍关系数据库的设计思想 在 SQL 中 一切皆关系 在计算机领域有许多伟大的设计理念和思想 例如 在 Unix 中 一切皆文件 在面向对象的编程语言中 一切皆对象 关系数据库同样也有自己的设计思想 在 SQL 中 一切皆关系 关系模型
  • HTML DOM Element对象

    HTML DOM 节点 在 HTML DOM Document Object Model 中 每个东西都是 节点 文档本身就是一个文档对象 所有 HTML 元素都是元素节点 所有 HTML 属性都是属性节点 插入到 HTML 元素文本是文本
  • 如何升级Vue

    如何将 2 9 6 Vue升级到3 0版本 新按装Vue可以使用如下命令按装Vue最新版本 npm install g vue cli 然后使用Vue V 或 vue version进行查看按装的最新版本 如果按装没有成功需要检查nodej
  • 第十届蓝桥杯C/C++B组试题水题解析

    第十届蓝桥杯C C B组试题水题解析 1 填空题 试题 A 组队 试题 B 年号字串 试题 C 数列求值 试题 D 数的分解 2 编程题 试题 F 特别数的和 试题 G 完全二叉树的权值 试题 H 等差数列 试题 I 后缀表达式 这一届蓝桥
  • WebAssembly的Qt

    Qt for WebAssembly WebAssembly的Qt Qt for Webassembly lets you to run Qt applications on the web Qt for Webassembly允许您在we
  • pip Could not find a version that satisfies the requirement *(from -r requirements.txt)

    在制作一个docker镜像的时候 RUN pip install r requirements txt i http pypi tuna tsinghua edu cn simple 但是报错说 找不到这个版本 我就去pypi搜 发现是有这
  • swagger 生成接口文档,并导出html和pdf的过程

    swagger 生成接口文档 并导出html和pdf的过程 这里写目录标题 swagger 生成接口文档 并导出html和pdf的过程 swagger 生成接口文档 swagger导出pdf和html 解决乱码问题 一 swagger 生成