Conversation
Blackgan3
reviewed
Jan 9, 2025
| ### 模版语法 | ||
|
|
||
| #### 事件处理 | ||
| 目前 Mpx 输出 React Native 的事件编写遵循小程序的事件编写规范,支持事件的冒泡及捕获 |
Collaborator
There was a problem hiding this comment.
Mpx 基础 - 事件处理章节可以进行一下更详细的描述补充
Blackgan3
reviewed
Jan 9, 2025
|
|
||
| ### 基础组件 | ||
| 目前 Mpx 输出 React Native 仅支持以下组件,文档中未提及的组件以及组件属性即为不支持,具体使用范围可参考如下文档 | ||
|
|
Collaborator
There was a problem hiding this comment.
可以补充一下支持透传 RN 特有属性 & 特有属性在跨平台时输出小程序、web时不生效
Blackgan3
reviewed
Jan 9, 2025
|
|
||
| | 事件名 | 说明 | | ||
| | ----------------| --------------------------------------------------- | | ||
| | bindtap | 点击的时候触发 | |
Blackgan3
reviewed
Jan 9, 2025
| | 属性名 | 类型 | 默认值 | 说明 | | ||
| | ----------------------- | ------- | ------------- | ---------------------------------------------------------- | | ||
| | user-select | boolean | `false` | 文本是否可选。 | | ||
| | disable-default-style | boolean | `false` | 会内置默认样式,比如fontSize为16。设置`true`可以禁止默认的内置样式。 | |
Blackgan3
reviewed
Jan 9, 2025
|
|
||
| | 事件名 | 说明 | | ||
| | ----------------| --------------------------------------------------- | | ||
| | bindtap | 点击的时候触发 | |
Blackgan3
reviewed
Jan 9, 2025
|
|
||
| | 属性名 | 类型 | 默认值 | 说明 | | ||
| | ----------------------- | ------- | ------------- | --------------------------------------------------------- | | ||
| | size | String | `default` | 按钮的大小 | |
Blackgan3
reviewed
Jan 9, 2025
| | 属性名 | 类型 | 默认值 | 说明 | | ||
| | ----------------------- | ------- | ------------- | --------------------------------------------------------- | | ||
| | size | String | `default` | 按钮的大小 | | ||
| | type | String | `default` | 按钮的样式类型 | |
Blackgan3
reviewed
Jan 9, 2025
| | 属性名 | 类型 | 默认值 | 说明 | | ||
| | ----------------------- | ------- | ------------- | ---------------------------------------------------------- | | ||
| | value | String | | 输入框的初始内容 | | ||
| | type | String | `text` | input 的类型,不支持 `safe-password`、`nickname` | |
Blackgan3
reviewed
Jan 9, 2025
| | maxlength | Number | `140` | 最大输入长度,设置为 -1 的时候不限制最大长度 | | ||
| | auto-focus | Boolean | `false` | (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 | | ||
| | focus | Boolean | `false` | 获取焦点 | | ||
| | confirm-type | String | `done` | 设置键盘右下角按钮的文字,仅在 type='text' 时生效 | |
Collaborator
There was a problem hiding this comment.
confirm-type 有哪些类型也可以枚举一下
Blackgan3
reviewed
Jan 9, 2025
| | auto-focus | Boolean | `false` | (即将废弃,请直接使用 focus )自动聚焦,拉起键盘 | | ||
| | focus | Boolean | `false` | 获取焦点 | | ||
| | auto-height | Boolean | `false` | 是否自动增高,设置 auto-height 时,style.height不生效 | | ||
| | confirm-type | String | `done` | 设置键盘右下角按钮的文字,不支持 `return` | |
Blackgan3
reviewed
Jan 9, 2025
Blackgan3
reviewed
Jan 9, 2025
| | 属性名 | 类型 | 默认值 | 说明 | | ||
| | ----------------------- | ------- | ------------- | ---------------------------------------------------------- | | ||
| | src | String | `false` | 图片资源地址及 base64 格式数据 | | ||
| | mode | String | `scaleToFill` | 图片裁剪、缩放的模式,适配微信 image 所有 mode 格式 | |
Blackgan3
reviewed
Jan 9, 2025
|
|
||
|
|
||
|
|
||
| #### canvas |
Collaborator
There was a problem hiding this comment.
canvas 的使用文档是否有?看下是否可以在Mpx内补充或者外链出去
Blackgan3
reviewed
Jan 9, 2025
| ```javascript | ||
| // 全量引入api-proxy | ||
| import mpx from '@mpxjs/core' | ||
| import apiProxy from '@didi/mpxjs-api-proxy' |
Blackgan3
reviewed
Jan 9, 2025
| ``` | ||
| 需要在mpx项目中需要配置externals | ||
| ``` | ||
| externals: { |
Collaborator
There was a problem hiding this comment.
externals 可以给出详细的 vue.config.js 的配置方式,或者说明下需要在 webpack 中配置也行
Collaborator
There was a problem hiding this comment.
这个地方好像也不需要吧,脚手架生成的Mpx项目中自动带上不就行了
Blackgan3
reviewed
Jan 9, 2025
|
|
||
| ### 应用能力 | ||
| ##### invoke示例代码 | ||
| 对于业务中一些特殊的方法,需要有web与RN进行交互的这种情况,基于这种情况在mpx框架内部提供了挂在方法的能力,在webview-bridge提供了invoke通信的能力,具体使用方法如下: |
Collaborator
There was a problem hiding this comment.
"基于这种情况在mpx框架内部提供了挂在方法的能力"
有个错别字
d443ef4 to
1c36b79
Compare
…into feat-rn-components-doc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.