File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22name : mpx2rn
33description : Mpx 跨端输出 RN(简称 Mpx2RN 或 Mpx2DRN)的开发适配指南,覆盖模板、脚本、样式、JSON 配置四大维度。当用户进行 Mpx2RN 相关任务时强制调用,包括但不限于:技术方案设计、页面 / 组件的开发迭代、旧项目跨端适配改造、编译和运行时报错排查、Code Review 等。当用户问题不涉及 Mpx2RN 时不应调用,如 Mpx 小程序开发问题,RN 原生开发问题、Mpx2Web 相关问题等。
44metadata :
5- version : " 2.12.4 "
5+ version : " 2.12.5 "
66 author : donghongping
77---
88
@@ -105,6 +105,7 @@ Mpx 是一个以微信小程序语法为基础、进行了类 Vue 语法拓展
105105
1061061 . ** 支持范围** :应用、页面与组件配置字段须在[ JSON 配置参考] ( ./references/rn-json-reference.md ) 标注的 RN 支持范围内;` tabBar ` 等不支持字段通过条件编译隔离。
1071072 . ** 动态生成配置** :需要分平台或分环境定义配置时,使用 ` <script name="json"> ` 并通过 ` __mpx_mode__ ` / ` __mpx_env__ ` 动态生成。
108+ 3 . ** 页面滚动** :页面 JSON 将 ` disableScroll ` 设为 ` true ` ,样式声明 ` page { height: 100%; } ` ,并使用开启 ` scroll-y ` 的 ` scroll-view ` 承载滚动内容。
108109
109110### 条件编译开发约束
110111
Original file line number Diff line number Diff line change 101101| ` onReachBottomDistance ` | 输出 RN 时无效,应在模板中结合 ` scroll-view ` 相关能力进行跨端兼容实现。 |
102102| ` disableKeyboardAvoiding ` | 仅输出 RN 时有效,为 ` true ` 时关闭框架自带的键盘避让包裹,开发者自行处理键盘遮挡。 |
103103
104- ** 注意** :跨端输出时 ** ` disableScroll ` 宜为 ` true ` ** ,在 ` <template> ` 里用 ** ` scroll-y ` 的 ` scroll-view ` ** 包裹需要滚动的内容,与 RN 侧行为对齐。下拉刷新、触底等请结合 ` scroll-view ` 事件与业务逻辑实现。
104+ ** 注意** :跨端输出 RN 时 ** ` disableScroll ` 设为 ` true ` ** ,同时在 ` <style> ` 中声明 ** ` page { height: 100%; } ` ** ,并在 ` < template>` 里用开启 ** ` scroll-y ` ** 的 ` scroll-view ` 包裹需要滚动的内容,与 RN 侧行为对齐。下拉刷新、触底等请结合 ` scroll-view ` 事件与业务逻辑实现。
105105
106106---
107107
@@ -472,4 +472,4 @@ loadUtil().then((mod) => {
472472 }
473473 }
474474}
475- ```
475+ ```
You can’t perform that action at this time.
0 commit comments