forked from chengazhen/generate-swagger-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
129 lines (111 loc) · 3.68 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!--
* @Description:
* @Author:
* @LastEditors: chengchongzhen
* @Date: 2021-11-15 16:45:09
* @LastEditTime: 2023-06-18 13:32:22
-->
<!DOCTYPE html>
<html>
<head>
<style>
html,
body,
#app {
height: 100%;
}
body {
overflow-y: auto;
}
* {
margin: 0;
padding: 0;
}
.form-card {
position: sticky;
top: 0;
z-index: 9;
}
.clearfix:before,
.clearfix:after {
display: table;
content: '';
}
.clearfix:after {
clear: both;
}
.form-card .el-form-item {
margin-bottom: 0;
}
.box-card {
margin-top: 20px;
}
</style>
<meta charset="UTF-8"/>
<!-- import CSS -->
<!-- <link
rel="stylesheet"
href="https://unpkg.com/ElementPlus-ui/lib/theme-chalk/index.css"
/> -->
<link href="https://cdn.jsdelivr.net/npm/element-plus@2.2.0/dist/index.css" rel="stylesheet"/>
</head>
<body>
<!-- <a href="https://github.com/azhen98/generate-swagger-web">
<img style="
position: fixed;
top: 0;
right: 0;
width: 80px;
height: 80px;
border: 0;
z-index: 999;
" src="https://nihaojob.github.io/markdown-css-smartisan/examples/fork-me-right-graphite@2x.png"
alt="Fork me on GitHub" />
</a> -->
<div id="app">
<div element-loading-background="rgba(122, 122, 122, 0.8)" element-loading-text="Loading..." style="height: 100%;"
v-loading="loading">
<div style="position: fixed;right: 0; top: 0; z-index: 100;">
<mark style="margin-left: 20px;">兼容swagger, apifox</mark>
</div>
<el-card class="form-card" shadow="never">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="文档接口">
<el-input @change="urlInput" placeholder="文档接口,不需要swagger.html路径" v-model="formInline.url">
</el-input>
</el-form-item>
<el-form-item>
<el-link href="https://github.com/SHERlocked93/generate-swagger-web" target="_blank" type="primary">
github仓库
</el-link>
</el-form-item>
</el-form>
</el-card>
<el-card class="box-card" shadow="never">
<el-row :gutter="20">
<el-col :span="24">
<el-card>
<div slot="header">
<el-tag>api 接口</el-tag>
<el-button :data-clipboard-text="apiGenerate" class="copyBtn" plain size="small"
style="float: right"
type="primary">复制所有代码
</el-button>
</div>
<pre v-html="apiGenerate"></pre>
</el-card>
</el-col>
</el-row>
</el-card>
</div>
</div>
</body>
<script src="https://unpkg.com/vue@3"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/vue@3.2.37/dist/vue.global.min.js"></script> -->
<!-- <script src="https://unpkg.com/ElementPlus-ui/lib/index.js"></script> -->
<script src="https://cdn.jsdelivr.net/npm/element-plus@2.2.0/dist/index.full.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script>
<script src="./index.js">
</script>
</html>