Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_42664012
unidocs-zh
提交
d4776fb6
U
unidocs-zh
项目概览
qq_42664012
/
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,体验更适合开发者的 AI 搜索 >>
提交
d4776fb6
编写于
2月 24, 2022
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 路由重定向,路由补全
上级
b5c220a8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
137 addition
and
5 deletion
+137
-5
docs/.vuepress/config.js
docs/.vuepress/config.js
+3
-0
docs/.vuepress/markdown/normallizeLink.js
docs/.vuepress/markdown/normallizeLink.js
+25
-0
docs/.vuepress/theme/config/redirectRouter.js
docs/.vuepress/theme/config/redirectRouter.js
+95
-0
docs/.vuepress/theme/enhanceApp.js
docs/.vuepress/theme/enhanceApp.js
+13
-4
docs/component/component-selection.md
docs/component/component-selection.md
+1
-1
未找到文件。
docs/.vuepress/config.js
浏览文件 @
d4776fb6
...
...
@@ -67,6 +67,9 @@ const config = {
.
end
()
.
plugin
(
'
convert-header
'
)
.
use
(
headerPlugin
)
},
extendMarkdown
:
md
=>
{
md
.
use
(
require
(
'
./markdown/normallizeLink
'
))
}
}
}
...
...
docs/.vuepress/markdown/normallizeLink.js
0 → 100644
浏览文件 @
d4776fb6
const
fs
=
require
(
'
fs
'
)
const
folderNames
=
[]
fs
.
readdirSync
(
'
docs
'
).
forEach
(
item
=>
{
fs
.
lstatSync
(
`docs/
${
item
}
`
).
isDirectory
()
&&
folderNames
.
push
(
item
)
})
function
isExternal
(
path
)
{
return
/^
[
a-z
]
+:/i
.
test
(
path
)
}
function
normalizeLink
(
url
)
{
if
(
!
url
.
startsWith
(
'
/
'
)
&&
folderNames
.
some
(
item
=>
url
.
startsWith
(
item
)))
{
return
'
/
'
+
url
}
return
url
}
module
.
exports
=
function
(
md
)
{
md
.
normalizeLink
=
(
function
(
oldNormalizeLink
)
{
return
function
(
url
)
{
url
=
isExternal
(
url
)
?
url
:
normalizeLink
(
url
)
return
oldNormalizeLink
.
bind
(
this
)(
url
)
}
})(
md
.
normalizeLink
)
}
\ No newline at end of file
docs/.vuepress/theme/config/redirectRouter.js
0 → 100644
浏览文件 @
d4776fb6
const
routerMap
=
{
'
/collocation/frame/lifecycle#页面生命周期
'
:
'
/tutorial/page.html#lifecycle
'
,
'
/collocation/frame/lifecycle#应用生命周期
'
:
'
/collocation/App.html#applifecycle
'
,
'
/collocation/frame/lifecycle
'
:
'
/collocation/App.html#applifecycle
'
,
'
/collocation/frame/communication
'
:
'
/tutorial/page.html#页面通讯
'
,
'
/collocation/frame/lifecycle#page
'
:
'
/collocation/App.html#applifecycle
'
,
'
/collocation/frame/lifecycle#component
'
:
'
/tutorial/page.html#componentlifecycle
'
,
'
/collocation/frame/timer
'
:
'
/api/timer.html
'
,
'
/collocation/auto/hbuilderx-extension/index
'
:
'
/worktile/auto/hbuilderx-extension/
'
,
'
/collocation/auto/quick-start
'
:
'
/worktile/auto/quick-start.html
'
,
'
/collocation/auto/uniapp-cli-project
'
:
'
/worktile/auto/uniapp-cli-project.html
'
,
'
/collocation/i18n
'
:
'
/worktile/i18n.html
'
,
'
/collocation/env
'
:
'
/tutorial/env.html
'
,
'
/collocation/ssr
'
:
'
/tutorial/ssr.html
'
,
'
/collocation/frame/window#getapp
'
:
'
/tutorial/page.html#getapp
'
,
'
/component/mp-weixin-plugin
'
:
'
/tutorial/mp-weixin-plugin.html
'
,
'
/component/uniui
'
:
'
/component/uniui/uni-ui.html
'
,
'
/frame
'
:
'
/tutorial/
'
,
'
/frame#renderjs
'
:
'
/tutorial/renderjs.html
'
,
'
/frame#css变量
'
:
'
/tutorial/syntax-css.html#css-变量
'
,
'
/frame#css引入静态资源
'
:
'
/tutorial/page-static-assets.html
'
,
'
/frame#js文件引入
'
:
'
/tutorial/page-script.html
'
,
'
/frame#字体图标
'
:
'
/tutorial/syntax-css.html#字体图标
'
,
'
/frame#wxs
'
:
'
/tutorial/miniprogram-subject.html#wxs
'
,
'
/frame#flex布局
'
:
'
/tutorial/syntax-css.html#flex-布局
'
,
'
/frame#npm支持
'
:
'
/tutorial/page-script.html#npm支持
'
,
'
/frame#尺寸单位
'
:
'
/tutorial/syntax-css.html#尺寸单位
'
,
'
/frame#目录结构
'
:
'
/tutorial/project.html#目录结构
'
,
'
/frame#路由跳转
'
:
'
/tutorial/page.html#路由跳转
'
,
'
/frame#小程序组件支持
'
:
'
/tutorial/miniprogram-subject.html
'
,
'
/frame#小程序自定义组件支持
'
:
'
/tutorial/miniprogram-subject.html#小程序自定义组件支持
'
,
'
/frame#判断平台
'
:
'
/worktile/running-env.html#判断平台
'
,
'
/frame#typescript-支持
'
:
'
/tutorial/typescript-subject.html#typescript-支持
'
,
'
/frame#全局样式与局部样式
'
:
'
/tutorial/syntax-css.html#全局样式与局部样式
'
,
'
/frame#注意事项-1
'
:
'
/tutorial/renderjs.html#注意事项
'
,
'
/platform
'
:
'
/tutorial/platform.html
'
,
'
/api/extend/native-plugin
'
:
'
/plugin/native-plugin.html
'
,
'
/use-html5plus
'
:
'
/tutorial/use-html5plus.html
'
,
'
/vue-components
'
:
'
/tutorial/vue-components.html
'
,
'
/vue-components.html
'
:
'
/tutorial/vue-components.html
'
,
'
/vue-basics
'
:
'
/tutorial/vue-basics.html
'
,
'
/vue-api
'
:
'
/tutorial/vue-api.html
'
,
'
/vue-vuex
'
:
'
/tutorial/vue-vuex.html
'
,
'
/vue3-api
'
:
'
/tutorial/vue3-api.html
'
,
'
/vue3-basics
'
:
'
/tutorial/vue3-basihybridcs.html
'
,
'
/vue3-vuex
'
:
'
/tutorial/vue3-vuex.html
'
,
'
/migration-to-vue3
'
:
'
/tutorial/migration-to-vue3.html
'
,
'
/nvue-outline
'
:
'
/tutorial/nvue-outline.html
'
,
'
/nvue-api
'
:
'
/tutorial/nvue-api.html
'
,
'
/nvue-css
'
:
'
/tutorial/nvue-css.html
'
,
'
/uniCloud/database
'
:
'
/uniCloud/clientdb.html
'
,
'
/plugin/hybrid
'
:
'
/hybrid.html
'
,
'
/adapt
'
:
'
/tutorial/adapt.html
'
,
'
/share
'
:
'
/api/plugins/share.html
'
,
'
/performance
'
:
'
/tutorial/performance.html
'
,
'
/use-weex
'
:
'
/tutorial/nvue-outline.html
'
,
'
/uni_modules
'
:
'
/plugin/uni_modules.html
'
,
'
/snippet
'
:
'
/tutorial/snippet.html
'
,
}
export
default
({
fullPath
,
path
,
hash
})
=>
{
fullPath
=
decodeURIComponent
(
fullPath
)
const
matchFullPath
=
routerMap
[
fullPath
];
if
(
matchFullPath
)
{
return
{
path
:
matchFullPath
,
replace
:
true
}
}
const
matchPath
=
routerMap
[
path
]
if
(
matchPath
)
{
return
{
path
:
matchPath
,
hash
,
replace
:
true
}
}
if
(
path
.
indexOf
(
'
/app-
'
)
===
0
||
path
.
indexOf
(
'
/android-
'
)
===
0
||
path
.
indexOf
(
'
/ios-
'
)
===
0
)
{
return
{
path
:
`/tutorial
${
path
}
`
,
hash
,
replace
:
true
}
}
}
\ No newline at end of file
docs/.vuepress/theme/enhanceApp.js
浏览文件 @
d4776fb6
import
getRedirectRouter
from
'
./config/redirectRouter
'
;
function
handleRedirectForCleanUrls
(
router
,
to
)
{
if
(
isRouteExists
(
router
,
to
.
path
))
{
return
to
.
path
...
...
@@ -31,25 +33,32 @@ function isRouteExists(router, path) {
}
function
handlePath
(
router
,
to
)
{
// 重定向路由表
const
redirectRouter
=
getRedirectRouter
(
to
)
if
(
redirectRouter
)
return
redirectRouter
const
id
=
to
.
query
.
id
const
hash
=
decodeURIComponent
(
id
||
to
.
hash
).
toLowerCase
()
const
redirectPath
=
handleRedirectForCleanUrls
(
router
,
to
)
if
(
id
)
{
return
{
path
:
redirectPath
,
hash
:
'
#
'
+
decodeURIComponent
(
id
.
toLowerCase
())
replace
:
true
,
hash
}
}
if
(
redirectPath
!==
to
.
path
)
{
return
{
path
:
redirectPath
,
hash
:
decodeURIComponent
(
to
.
hash
).
toLowerCase
()
replace
:
true
,
hash
}
}
if
(
/
\b
README
\b
/
.
test
(
to
.
path
))
{
return
{
path
:
to
.
path
.
replace
(
/
\b
README
\b
/
,
''
),
hash
:
decodeURIComponent
(
to
.
hash
).
toLowerCase
()
replace
:
true
,
hash
}
}
}
...
...
docs/component/component-selection.md
浏览文件 @
d4776fb6
...
...
@@ -68,7 +68,7 @@ uni ui有如下优势:
#### 插件市场更多组件
插件市场,
[
https://ext.dcloud.net.cn
](
https://ext.dcloud.net.cn
)
,有各种玲琅满目的组件、模板。
其中成套的全端兼容ui库包括:
-
[
uViewUI
](
www.uviewui.com
)
:整合了非常多组件,功能丰富、文档清晰,但不支持nvue
-
[
uViewUI
](
https://
www.uviewui.com
)
:整合了非常多组件,功能丰富、文档清晰,但不支持nvue
-
[
colorUI css库
](
http://ext.dcloud.net.cn/plugin?id=239
)
:颜值很高,css库而非组件
-
[
unify UI
](
https://ext.dcloud.net.cn/plugin?id=2251
)
:全端支持的组件库,侧重nvue
-
[
mypUI
](
https://ext.dcloud.net.cn/plugin?id=2190
)
:全端支持的组件库,侧重nvue
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录