Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tc.小浩
unidocs-zh
提交
67f9f3f6
U
unidocs-zh
项目概览
Tc.小浩
/
unidocs-zh
与 Fork 源项目一致
Fork自
DCloud / unidocs-zh
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67f9f3f6
编写于
3月 14, 2022
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: pc、slugify
上级
29339796
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
175 addition
and
13 deletion
+175
-13
docs/.vuepress/config.js
docs/.vuepress/config.js
+4
-12
docs/.vuepress/utils/index.js
docs/.vuepress/utils/index.js
+14
-1
static/pc.html
static/pc.html
+157
-0
未找到文件。
docs/.vuepress/config.js
浏览文件 @
67f9f3f6
...
...
@@ -2,6 +2,7 @@ const { slugify } = require('@vuepress/shared-utils')
const
translatePlugin
=
require
(
'
./markdown/translate
'
)
const
headerPlugin
=
require
(
'
./markdown/header
'
)
const
createSidebar
=
require
(
'
./markdown/createSidebar
'
)
const
{
simplifySlugText
}
=
require
(
'
./utils
'
)
const
tabs
=
[
'
/uniCloud/
'
,
'
/plugin/
'
,
'
/worktile/
'
,
'
/tutorial/
'
,
'
/collocation/
'
,
'
/component/
'
,
'
/api/
'
,
'
/
'
]
...
...
@@ -40,24 +41,15 @@ const config = {
},
markdown
:
{
slugify
(
str
)
{
let
slug
=
str
if
(
typeof
str
!==
'
string
'
)
return
''
let
slug
=
str
if
(
slug
.
includes
(
'
@
'
))
{
let
array
=
slug
.
split
(
'
@
'
)
slug
=
array
.
length
>
1
?
array
[
array
.
length
-
1
]
:
str
}
else
{
const
UNI
=
'
uni.
'
if
(
slug
.
startsWith
(
UNI
))
{
slug
=
slug
.
split
(
UNI
)[
1
]
}
if
(
slug
.
indexOf
(
'
OBJECT
'
)
!==
-
1
)
{
[
'
(
'
,
'
(
'
].
forEach
(
item
=>
{
if
(
slug
.
indexOf
(
item
)
!==
-
1
)
slug
=
slug
.
split
(
item
)[
0
].
toLocaleLowerCase
();
})
slug
=
simplifySlugText
(
slug
.
toLowerCase
()).
trim
()
}
}
return
slugify
(
slug
)
},
extractHeaders
:
[
'
h1
'
,
'
h2
'
,
'
h3
'
,
'
h4
'
],
...
...
docs/.vuepress/utils/index.js
浏览文件 @
67f9f3f6
...
...
@@ -2,6 +2,19 @@ function isExternal(path) {
return
/^
[
a-z
]
+:/i
.
test
(
path
)
}
function
simplifySlugText
(
text
)
{
// 移除方法后面的括号及里面的内容
if
(
text
.
match
(
/^uni/
)
&&
text
.
match
(
/
\)
$/
))
{
text
=
text
.
replace
(
/^uni/
,
''
).
replace
(
/
\(
.*
\)
$/
,
''
);
}
// 处理部分非uni开头方法的括号内容,主要是会出现多参数的情况。
if
(
text
.
match
(
/
\([\w
+
\s
+
\[\]
,
]
+
\)
$/
))
{
text
=
text
.
replace
(
/
\([\w
+
\s
+
\[\]
,
]
+
\)
$/
,
''
);
}
return
text
;
}
module
.
exports
=
{
isExternal
isExternal
,
simplifySlugText
}
\ No newline at end of file
static/pc.html
0 → 100644
浏览文件 @
67f9f3f6
<!DOCTYPE html>
<html
lang=
zh-CN
>
<head>
<meta
charset=
utf-8
>
<meta
http-equiv=
X-UA-Compatible
content=
"IE=edge"
>
<meta
name=
viewport
content=
"width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"
>
<title></title>
<style
type=
"text/css"
>
body
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
overflow
:
hidden
;
}
.wrapper
{
width
:
500px
;
height
:
500px
;
position
:
absolute
;
top
:
50%
;
left
:
50%
;
margin-top
:
-200px
;
margin-left
:
-500px
;
text-align
:
center
;
}
.barcode-image
{
display
:
inline-block
;
vertical-align
:
middle
;
width
:
200px
;
height
:
200px
;
}
.list
{
width
:
500px
;
}
.h5-viwer-box
{
position
:
absolute
;
width
:
45vh
;
height
:
80vh
;
right
:
50px
;
top
:
8vh
;
box-sizing
:
content-box
;
border
:
solid
10px
#000000
;
border-radius
:
10px
;
box-shadow
:
#DDDDDD
10px
10px
20px
;
}
.h5-viwer
{
width
:
45vh
;
height
:
80vh
;
border
:
0
;
padding
:
0
;
}
.h5-copy-link
{
position
:
absolute
;
width
:
45vh
;
height
:
40px
;
right
:
50px
;
bottom
:
4vh
;
text-align
:
center
;
}
#copy-link-btn
{
display
:
inline-block
;
width
:
100px
;
height
:
40px
;
text-align
:
center
;
line-height
:
40px
;
border-radius
:
6px
;
color
:
white
;
font-size
:
16px
;
cursor
:
pointer
;
user-select
:
none
;
-ms-user-select
:
none
;
-moz-user-select
:
none
;
-webkit-user-select
:
none
;
background-color
:
#42b983
;
}
#copy-link-btn
:active
{
opacity
:
0.7
;
}
#copy-link-tooltip
{
position
:
absolute
;
width
:
100px
;
height
:
30px
;
left
:
50%
;
top
:
5px
;
margin-left
:
120px
;
line-height
:
30px
;
color
:
white
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
border-radius
:
6px
;
opacity
:
0
;
transition
:
all
0.3s
ease
;
-ms-transition
:
all
0.3s
ease
;
-moz-transition
:
all
0.3s
ease
;
-webkit-transition
:
all
0.3s
ease
;
}
#copy-link-tooltip
:after
{
content
:
""
;
position
:
absolute
;
width
:
0
;
height
:
0
;
right
:
100%
;
top
:
50%
;
margin-top
:
-8px
;
border
:
solid
8px
transparent
;
border-right
:
solid
8px
rgba
(
0
,
0
,
0
,
0.5
);
}
#copy-link-tooltip
.show
{
opacity
:
1
;
transform
:
translateX
(
-50px
);
-ms-transform
:
translateX
(
-50px
);
-moz-transform
:
translateX
(
-50px
);
-webkit-transform
:
translateX
(
-50px
);
}
</style>
</head>
<body>
<div
class=
"wrapper"
>
<canvas
id=
"canvas"
class=
"barcode-image"
></canvas>
<div
class=
"list"
>
<p
class=
"list-cell"
>
请使用手机浏览器,扫描上方二维码浏览。
</p>
</div>
</div>
<div
class=
"h5-viwer-box"
>
<iframe
id=
"iframe"
class=
"h5-viwer"
src=
""
width=
"414"
height=
"736"
></iframe>
</div>
<script
src=
"https://unpkg.com/qrcode@1.4.4/build/qrcode.min.js"
></script>
<script>
var
src
=
decodeURIComponent
(
location
.
hash
.
replace
(
/^#/
,
''
))
if
(
!
/^https
?
:
\/\/
/
.
test
(
src
))
{
src
=
'
https://uniapp.dcloud.io/h5/
'
}
document
.
getElementById
(
'
iframe
'
).
src
=
src
QRCode
.
toCanvas
(
document
.
getElementById
(
'
canvas
'
),
src
)
var
userAgent
=
navigator
.
userAgent
window
.
addEventListener
(
'
resize
'
,
function
()
{
if
(
navigator
.
userAgent
!==
userAgent
)
{
location
.
replace
(
src
)
}
})
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录