Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
1dfb57d
docs: 调整跨端输出目录
Blackgan3 Aug 27, 2025
2764f50
Merge branch 'master' into docs-refactor
Aug 28, 2025
1b38d19
doc: 补充基础组件&自定义组件文档
Aug 28, 2025
8fe1fac
docs: 新增事件文档
Aug 28, 2025
028a537
修改api-proxy相关部分的文档
Aug 28, 2025
0d5f7d0
docs: 新增生命周期文档
Aug 28, 2025
95b0a89
docs: 新增生命周期文档
Aug 29, 2025
2e9f2a2
docs: 补充生命周期文档
Aug 29, 2025
e382635
docs: 补充应用能力文档
Aug 29, 2025
b7484c8
docs: 补充应用能力文档
Aug 29, 2025
f4705c3
补充部分api先提交一版
Sep 1, 2025
0bcdfa9
docs: 修改文档格式
Sep 1, 2025
b2f5116
docs: 修改文档格式
Sep 1, 2025
4154bf1
doc: 修改样式文档
Sep 1, 2025
ee93f66
doc: 修改样式文档
Sep 1, 2025
9b55e8d
doc: 修改样式文档
Sep 2, 2025
cc48949
api文档开发第二阶段提交
Sep 2, 2025
a8fef07
doc: 修改样式文档
Sep 2, 2025
d893d5e
提交增加的api-proxy文档的文件
Sep 3, 2025
9a7da1e
Merge branch 'docs-refactor' of https://github.com/didi/mpx into docs…
Sep 3, 2025
fb1c5a4
删掉多余的api-proxy的文档
Sep 3, 2025
d495795
补充文件
Sep 4, 2025
ec21e30
doc: 修改文档
Sep 4, 2025
a0bbe5f
feat(docs): enhance collapsed config for api-proxy
wangshunnn Sep 4, 2025
34fa8c3
补充getUserInfo
Sep 4, 2025
29cf03b
删除所有特别说明的harmony
Sep 4, 2025
41a3a47
feat(docs): update API sidebar text and improve CSS variable
wangshunnn Sep 4, 2025
d2a2c8e
doc: 修改文档
Sep 4, 2025
e9df1e9
Merge branch 'docs-refactor' of https://github.com/didi/mpx into docs…
Sep 4, 2025
6f62231
doc: 修改文档
Sep 4, 2025
cf8dd15
doc: 修改文档
Sep 5, 2025
6a0a7fe
docs: update nav config for rn
wangshunnn Sep 9, 2025
822045e
docs: refactor mpx2rn docs
wangshunnn Sep 9, 2025
08598f4
docs: refactor rn docs dir
wangshunnn Sep 9, 2025
dc9758a
docs: update unocss config demo code
wangshunnn Sep 9, 2025
d3e9e4e
doc: 补充RN文档
mackwang112 Sep 10, 2025
de46867
chore: refactor vitepress config
wangshunnn Sep 10, 2025
d7624bf
docs: update post
wangshunnn Sep 10, 2025
3fae1e2
docs: optimize
wangshunnn Sep 10, 2025
8ac945c
docs: update
wangshunnn Sep 10, 2025
6e56767
修正文档
Sep 10, 2025
93ddafa
docs: update
wangshunnn Sep 12, 2025
cc8b2f9
Merge branch 'master' into docs-refactor
wangshunnn Sep 15, 2025
d64fb98
docs: remove legacy rn file
wangshunnn Sep 15, 2025
39cbfe6
docs: 跨端基础-条件编译配置章节重构
Blackgan3 Sep 15, 2025
887b068
docs: beatify with custom containers and badge
wangshunnn Sep 15, 2025
fcd51ac
Merge remote-tracking branch 'origin/docs-refactor' into docs-refactor
Blackgan3 Sep 15, 2025
97d847a
docs: refactor and enhance
wangshunnn Sep 15, 2025
66c41bd
docs: 修改文档
Sep 15, 2025
0d94ec0
Merge branch 'docs-refactor' of https://github.com/didi/mpx into docs…
Sep 17, 2025
c2131c8
doc: 删除基础能力
Sep 17, 2025
2ef9382
docs: 优化基础组件文档样式
Sep 17, 2025
e385a18
Merge branch 'master' into docs-refactor
wangshunnn Sep 18, 2025
ea1dd90
docs: remove ecosystem section and related SDK documentation
wangshunnn Sep 18, 2025
d27c2e8
修正getNetworkType rn下支持能力的说明
wangxiaokou Sep 25, 2025
796c9aa
docs(rn): 添加 picker-view 的 enable-wheel-animation 属性说明(2.10.17+)
wangshunnn Oct 20, 2025
bfde762
Merge branch 'master' into docs-refactor
wangshunnn Oct 20, 2025
eb7ee91
chore: remove cache
wangshunnn Oct 20, 2025
bfbd146
docs: update
wangshunnn Oct 21, 2025
ccb130f
doc: 修改createSelectorQuery文档
Oct 24, 2025
8d53579
Merge branch 'docs-refactor' of https://github.com/didi/mpx into docs…
Oct 24, 2025
8da6d57
docs: refactor toc structure
wangshunnn Oct 24, 2025
529af98
Merge branch 'master' into docs-refactor
wangshunnn Oct 24, 2025
f6bf432
Merge branch 'master' into docs-refactor
wangshunnn Oct 24, 2025
49bd095
docs: remove deprecated file
wangshunnn Oct 28, 2025
4408226
docs: remove deprecated file
wangshunnn Oct 28, 2025
7f092cd
feat: update
wangshunnn Oct 29, 2025
05c5e95
feat: update
wangshunnn Oct 29, 2025
e4c756d
docs: 修改createSelectorQuery文档
Oct 29, 2025
1c0dcbc
Merge branch 'docs-refactor' of https://github.com/didi/mpx into docs…
Oct 29, 2025
8e36c0e
docs: 修正 RN 样式文档 calc() 示例中 parent-width/parent-height 为模板插值语法
wangshunnn Nov 5, 2025
0675547
docs: update `hold-keyboard`
wangshunnn Nov 6, 2025
d83efd8
docs: 补充 RN 样式文档 calc() 示例,明确在模板元素上指定 parent-width/parent-height 属性
wangshunnn Nov 6, 2025
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
1,344 changes: 1,022 additions & 322 deletions docs-vitepress/.vitepress/config.ts

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
138 changes: 138 additions & 0 deletions docs-vitepress/.vitepress/theme/alias-components/CustomFlyout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<script lang="ts" setup>
import { computed, ref } from 'vue'
import { useFlyout } from 'vitepress/dist/client/theme-default/composables/flyout.js'
import VPMenu from 'vitepress/dist/client/theme-default/components/VPMenu.vue'

const props = defineProps<{
icon?: string
button?: string
label?: string
items?: any[]
}>()

const open = ref(false)
const el = ref<HTMLElement>()
const isNew = computed(() => {
return props.items?.some(item => item.badge)
})

useFlyout({ el, onBlur })

function onBlur() {
open.value = false
}
</script>

<template>
<div
class="VPFlyout"
ref="el"
@mouseenter="open = true"
@mouseleave="open = false">
<button
type="button"
class="button"
aria-haspopup="true"
:aria-expanded="open"
:aria-label="label"
@click="open = !open">
<span v-if="button || icon" class="text">
<span v-if="icon" :class="[icon, 'option-icon']" />
<span v-if="button" v-html="button"></span>
<NavBarBadge v-if="isNew" />
<span class="vpi-chevron-down text-icon" />
</span>

<span v-else class="vpi-more-horizontal icon" />
</button>

<div class="menu">
<VPMenu :items="items">
<slot />
</VPMenu>
</div>
</div>
</template>

<style scoped>
.VPFlyout {
position: relative;
}

.VPFlyout:hover {
color: var(--vp-c-brand-1);
transition: color 0.25s;
}

.VPFlyout:hover .text {
color: var(--vp-c-text-2);
}

.VPFlyout:hover .icon {
fill: var(--vp-c-text-2);
}

.VPFlyout.active .text {
color: var(--vp-c-brand-1);
}

.VPFlyout.active:hover .text {
color: var(--vp-c-brand-2);
}

.button[aria-expanded="false"]+.menu {
opacity: 0;
visibility: hidden;
transform: translateY(0);
}

.VPFlyout:hover .menu,
.button[aria-expanded="true"]+.menu {
opacity: 1;
visibility: visible;
transform: translateY(0);
}

.button {
display: flex;
align-items: center;
padding: 0 12px;
height: var(--vp-nav-height);
color: var(--vp-c-text-1);
transition: color 0.5s;
}

.text {
display: flex;
align-items: center;
line-height: var(--vp-nav-height);
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-1);
transition: color 0.25s;
}

.option-icon {
margin-right: 0px;
font-size: 16px;
}

.text-icon {
margin-left: 4px;
font-size: 14px;
}

.icon {
font-size: 20px;
transition: fill 0.25s;
}

.menu {
position: absolute;
top: calc(var(--vp-nav-height) / 2 + 20px);
right: 0;
opacity: 0;
visibility: hidden;
transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<script lang="ts" setup>
import type { DefaultTheme } from 'vitepress/theme'
import { useData } from 'vitepress'
import { isActive } from 'vitepress/dist/client/shared.js'
import { VPLink } from 'vitepress/theme'

defineProps<{
item: DefaultTheme.NavItemWithLink
}>()

const { page } = useData()

defineOptions({ inheritAttrs: false })
</script>

<template>
<div class="VPMenuLink">
<VPLink
v-bind="$attrs"
:class="{
active: isActive(
page.relativePath,
item.activeMatch || item.link,
!!item.activeMatch
)
}"
:href="item.link"
:target="item.target"
:rel="item.rel"
:no-icon="item.noIcon">
<span v-html="item.text"></span>
<NavBarBadge v-if="item.badge" :text="item.badge.text" />
</VPLink>
</div>
</template>

<style scoped>
.VPMenuGroup+.VPMenuLink {
margin: 12px -12px 0;
border-top: 1px solid var(--vp-c-divider);
padding: 12px 12px 0;
}

.link {
display: block;
border-radius: 6px;
padding: 0 12px;
line-height: 32px;
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-1);
text-align: left;
white-space: nowrap;
transition:
background-color 0.25s,
color 0.25s;
}

.link:hover {
color: var(--vp-c-brand-1);
background-color: var(--vp-c-default-soft);
}

.link.active {
color: var(--vp-c-brand-1);
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<script lang="ts" setup>
import type { DefaultTheme } from 'vitepress/theme'
import { useData } from 'vitepress'
import { isActive } from 'vitepress/dist/client/shared.js'
import { VPLink } from 'vitepress/theme'

defineProps<{
item: DefaultTheme.NavItemWithLink
}>()

const { page } = useData()
</script>

<template>
<VPLink
:class="{
VPNavBarMenuLink: true,
active: isActive(
page.relativePath,
item.activeMatch || item.link,
!!item.activeMatch
)
}"
:href="item.link"
:target="item.target"
:rel="item.rel"
:no-icon="item.noIcon"
tabindex="0">
<span v-html="item.text"></span>
<NavBarBadge v-if="item.badge" :text="item.badge.text" />
</VPLink>
</template>

<style scoped>
.VPNavBarMenuLink {
display: flex;
align-items: center;
padding: 0 12px;
line-height: var(--vp-nav-height);
font-size: 14px;
font-weight: 500;
color: var(--vp-c-text-1);
transition: color 0.25s;
}

.VPNavBarMenuLink.active {
color: var(--vp-c-brand-1);
}

.VPNavBarMenuLink:hover {
color: var(--vp-c-brand-1);
}
</style>
5 changes: 3 additions & 2 deletions docs-vitepress/.vitepress/theme/components/CustomLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
const clipPath = [
`circle(0px at ${x}px ${y}px)`,
`circle(${Math.hypot(
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y),
Math.max(x, innerWidth - x),
Math.max(y, innerHeight - y),
)}px at ${x}px ${y}px)`,
]

Expand All @@ -37,6 +37,7 @@ provide('toggle-appearance', async ({ clientX: x, clientY: y }: MouseEvent) => {
{
duration: 300,
easing: 'ease-in',
fill: 'forwards',
pseudoElement: `::view-transition-${isDark.value ? 'old' : 'new'}(root)`,
},
)
Expand Down
28 changes: 28 additions & 0 deletions docs-vitepress/.vitepress/theme/components/NavBarBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script setup lang="ts">
defineProps<{
text?: string
}>()
</script>

<template>
<span class="badge">
{{ text || '新' }}
</span>
</template>

<style scoped>
.badge {
display: inline-block;
padding: 3.5px 4px;
margin-left: 6px;
font-size: 10px;
font-style: normal;
font-weight: 600;
line-height: 1;
letter-spacing: .2px;
border-radius: 6px;
background: #3b8eed;
color: #f9f9f9;
vertical-align: text-bottom;
}
</style>
5 changes: 4 additions & 1 deletion docs-vitepress/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { h } from "vue"
import DefaultTheme from "vitepress/theme"
import DefaultTheme, { VPBadge } from "vitepress/theme"
import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client"
import HomepageLayout from "./layouts/HomepageLayout.vue"
import NavBarBadge from "./components/NavBarBadge.vue"

import '@shikijs/vitepress-twoslash/style.css'
import "virtual:group-icons.css"
Expand All @@ -15,5 +16,7 @@ export default {
},
enhanceApp({ app }) {
app.use(TwoslashFloatingVue)
app.component('Badge', VPBadge)
app.component('NavBarBadge', NavBarBadge)
},
}
2 changes: 1 addition & 1 deletion docs-vitepress/.vitepress/theme/layouts/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="container">
<!-- <ParentLayout/>-->
<!-- <ParentLayout/> -->
</div>
</template>

Expand Down
1 change: 1 addition & 0 deletions docs-vitepress/.vitepress/theme/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
--vt-c-brand-light: var(--vt-c-green-light);
--vt-c-brand-dark: var(--vt-c-green-dark);
--vp-c-brand-1: var(--vt-c-brand);
--vp-c-brand-2: var(--vt-c-brand);
}

.dark {
Expand Down
8 changes: 8 additions & 0 deletions docs-vitepress/.vitepress/theme/styles/switchAppearance.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
.dark::view-transition-old(root) {
z-index: 9999;
}

.VPSwitchAppearance {
width: 22px !important;
}

.VPSwitchAppearance .check {
transform: none !important;
}
21 changes: 21 additions & 0 deletions docs-vitepress/api-proxy/base/app/app-event/offAppHide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## mpx.offAppHide(function listener)

移除小程序切后台事件的监听函数

支持情况: 微信、支付宝、RN、web

[参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppShow.html)

### 参数

**function listener**

onAppHide 传入的监听函数。不传此参数则移除所有监听函数(支付宝除外)。

### 示例代码
```js
const listener = function (res) { console.log(res) }

mpx.onAppHide(listener)
mpx.offAppHide(listener)
```
Loading