Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/docs #11

Merged
merged 4 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions config/config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,57 @@
export default {
title:" ",
title: 'Ant Design Mini',
favicon: 'https://gw.alipayobjects.com/zos/bmw-prod/35bd3910-2382-4f5d-903f-ac4c31b76199.svg',
logo: 'https://gw.alipayobjects.com/zos/bmw-prod/d1971355-ffff-44ef-9e20-1bc9a237d463.svg',
outputPath: 'docs-dist',
locales: [['zh', '中文']],
mode: 'site',
hash: true,
plugins: ['./plugin/index.ts'],
headScripts: [{ src: 'https://gw.alipayobjects.com/os/lib/ali/mini-simulator/9.1.5/dist/index.js' }],
styles:[`
plugins: ['./plugin/index.ts', './docs/mobile/index.ts'],
metas: [
{
name: 'viewport',
content:
'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover',
},
],
headScripts: [
{ src: 'https://unpkg.com/current-device/umd/current-device.min.js' },
{ src: 'https://gw.alipayobjects.com/os/lib/ali/mini-simulator/9.1.5/dist/index.js' },
{ src: 'https://v1.cnzz.com/z_stat.php?id=1280900245&web_id=1280900245' }
],
scripts: [
`
var a = document.querySelector(".__dumi-default-navbar-logo")
a.innerHTML = '';
if(device.mobile() && !window.location.pathname.startsWith('/mobile')){
window.location.href="/mobile"
}
`,
`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WWGN4HC');
`
],
styles: [`
html {
touch-action: manipulation;
}
#root .__dumi-default-navbar {
padding-left: 32px;
}
#root .__dumi-default-navbar-logo{
padding-left: 200px;
text-indent: -10000px;
}
#root .__dumi-default-navbar{
box-shadow: none;
border-bottom: 1px solid #ebedf1;
}
a[title='站长统计'] {
display: none;
}
#root .__dumi-default-device[data-device-type="iOS"] {
display: none;
}
Expand Down
13 changes: 13 additions & 0 deletions docs/mobile/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


import type { IApi } from '@umijs/types'

export default (api: IApi) => {
api.modifyRoutes(routes => {
routes.unshift({
path: '/mobile',
component: __dirname + '/mobile.tsx',
})
return routes
})
}
36 changes: 36 additions & 0 deletions docs/mobile/mobile.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.title {
justify-content: center;
white-space: nowrap;
font-size: 18px;
padding: 0 12px;
height: 45px;
display: flex;
color: #333;
align-items: center;
border-bottom: 1px solid #eee;
}
.img {
display: flex;
justify-content: center;

}

.container {
display: flex;
justify-content: center;
.demo {
background-color: #3978ff;
color: #fff;
font-size: 16px;
padding: 10px 36px;
border-radius: 100px;
text-decoration:none
}
}

.docs{
padding-top: 30px;
padding-bottom: 30px;
display: flex;
justify-content: center;
}
23 changes: 23 additions & 0 deletions docs/mobile/mobile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from "react";
import style from "./mobile.less"
export default ()=>{
return (
<>
<div className={style.title}>
Ant Design Mini
</div>
<div className={style.img}>
<img src="https://gw.alipayobjects.com/zos/bmw-prod/b874caa9-4458-412a-9ac6-a61486180a62.svg" alt="logo" width={'50%'}></img>
</div>
<div className={style.container}>
<a className={style.demo} href="alipays://platformapi/startapp?appId=2021003121607088&nbupdate=syncforce">
小程序 demo 预览
</a>
</div>

<div className={style.docs}>
<div>如果想查阅完整文档,请在 PC 端访问:<a href="https://mini.ant.design/">https://mini.ant.design/</a></div>
</div>
</>
)
}
1 change: 1 addition & 0 deletions src/Badge/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 导航
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Button/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---
# Button
Expand Down
1 change: 1 addition & 0 deletions src/Checkbox/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/CheckboxGroup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Collapse/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Container/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Dialog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---
# Dialog
Expand Down
1 change: 1 addition & 0 deletions src/Filter/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---
# Filter
Expand Down
1 change: 1 addition & 0 deletions src/Form/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 实验性质的组件
order: 5
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Icon/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/InputItem/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/List/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Loading/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---
# Loading
Expand Down
1 change: 1 addition & 0 deletions src/Modal/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---
# Modal
Expand Down
1 change: 1 addition & 0 deletions src/NoticeBar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 导航
order: 3
toc: false
---
# NoticeBar
Expand Down
1 change: 1 addition & 0 deletions src/Picker/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---
# Picker
Expand Down
1 change: 1 addition & 0 deletions src/Popover/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---
# Popover
Expand Down
1 change: 1 addition & 0 deletions src/Popup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/RadioGroup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---
# RadioGroup
Expand Down
1 change: 1 addition & 0 deletions src/Result/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/SafeArea/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 实验性质的组件
order: 5
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/SearchBar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Selector/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Stepper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Steps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 数据展示
order: 1
toc: false
---
# Steps
Expand Down
1 change: 1 addition & 0 deletions src/SwipeAction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 反馈
order: 2
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Switch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Tabs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 导航
order: 3
toc: false
---
# Tabs
Expand Down
1 change: 1 addition & 0 deletions src/Tag/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 导航
order: 3
toc: false
---
# Tag
Expand Down
1 change: 1 addition & 0 deletions src/Terms/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 表单类组件
order: 3
toc: false
---

Expand Down
1 change: 1 addition & 0 deletions src/Tips/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 导航
order: 3
toc: false
---
# Tips
Expand Down
1 change: 1 addition & 0 deletions src/VTabs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ nav:
path: /components
group:
title: 导航
order: 3
toc: false
---

Expand Down