-
Notifications
You must be signed in to change notification settings - Fork 389
feat: ali 环境支持recycle-view&sticky-header&sticky-section #2076
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
Open
yandadaFreedom
wants to merge
294
commits into
master
Choose a base branch
from
feat-sticky-ali-v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,067
−203
Open
Changes from 216 commits
Commits
Show all changes
294 commits
Select commit
Hold shift + click to select a range
6d22397
feat: add sticky-section 配置
156d402
Merge branch 'master' into feat-extend-sticky
4c7e647
chore: add sticky section config
5b1e320
fix: rn 吸顶逻辑计算
fe3dc93
feat: 支持padding属性
a325f03
fix: 导航条位置获取异常导致吸附位置不正确
93e0a07
feat: add sticky-section组件
63e6ea9
Merge branch 'master' into feat-recycle-list-web
a579c70
Merge branch 'master' into feat-extend-sticky
0d2484d
chore: 删除无用sticky组件
d7c7089
Merge branch 'master' into feat-extend-sticky
666202c
Merge branch 'master' into feat-recycle-list-web
438aed5
Merge branch 'feat-recycle-list-web' into feat-extend-sticky
09cc262
fix: add enableSticky 属性
3e89590
chore: del useless code
a4a9ba2
Merge branch 'feat-recycle-list-web' into feat-extend-sticky
a05fda4
fix: sticky-header
15dd08b
fix: AnimatedScrollView 生成时机
8f2b0a6
fix: AnimatedScrollView 生成时机
b3671e7
Merge branch 'master' into feat-extend-sticky
1f9ad4c
chore: 调整组件入参
371ccf8
fix: lint
ec78dde
Merge branch 'master' into feat-extend-sticky
9680227
fix: 外层做动画 android pageY 可能拿到不准问题
ae22a6c
Merge branch 'master' into feat-extend-sticky
c2eef9d
chore: 修改scroll触发逻辑
2ec66c0
chore: 修改scroll触发逻辑
4d7a2d2
chore: 修改 aboveCount 和 belowCount 计算逻辑
f311836
Merge branch 'feat-simple-view' into feat-extend-sticky
26d4413
Merge branch 'feat-simple-view' into feat-extend-sticky
730736d
chore: 调整组件重建时机
c29beeb
feat: 支持scrollTo方法
24e9183
chore: 新增支持props
c35d1a9
Merge branch 'feat-simple-view' into feat-extend-sticky
b178e62
Merge branch 'feat-simple-view' into feat-extend-sticky
15d84ee
Merge branch 'feat-simple-view' into feat-extend-sticky
d12815d
chore: add rn recyle
b9ce382
feat: 支持generic
b408c80
chore: 修改generic
0bd9f71
chore: 修改generic
d024f47
chore: 修改generic
7b87ad6
chore: 修改injectProperties注入时机
bf6d32f
fix: boundingClientRect 获取异常
a187e38
Merge branch 'feat-extend-sticky' into feat-generic-rn
acdefe2
chore: del
31d64fc
Merge branch 'feat-simple-view' into feat-extend-sticky
35b1fe3
Merge branch 'feat-generic-rn-new' into feat-extend-sticky
d64e552
Merge branch 'feat-extend-sticky' into feat-recycle-rn
a3f6a70
fix conflict
7d02911
Merge branch 'feat-extend-sticky' into feat-recycle-rn
6ec3a9c
chore: 增强recycle-view.
596026f
Merge branch 'feat-generic-rn-new' into feat-recycle-rn
0dc180b
Merge branch 'master' into feat-recycle-rn
5daf649
Merge branch 'feat-generic-rn-new' into feat-recycle-rn
5b51763
chore: 修改recycle逻辑
02fc308
Merge branch 'feat-generic-rn-new' into feat-recycle-rn
9ba79c9
Merge branch 'master' into feat-recycle-rn
28ed166
chore: 修改文件路径
83bb124
Merge branch 'feat-generic-rn-new' into feat-recycle-rn
ad11b1a
Merge branch 'master' into feat-recycle-rn
798a1cf
Merge branch 'master' into feat-recycle-rn
4f409dc
fix: lint;
f5fcefe
feat: 补充recycle能力
5148785
feat: 优化小程序 recycle-view
835368b
chore: 调整recycle目录
760dccd
Merge branch 'feat-sticky-rn' into feat-recycle-rn
0ce6847
feat: 支持 rn 环境recycle
c192ec0
chore: rn环境支持recycle-view
de646d4
chore: rn环境支持recycle-view
0ab5792
chore: 调试recycle
48a2364
chore: 调试recycle
d207cdd
chore: 调试getSectionItemLayout
1e764fa
chore: 调试getSectionItemLayout
c42ac70
chore: 调试getSectionItemLayout
fb36889
chore: 调试getSectionItemLayout
af7d0b6
chore: 兼容flatList
1e2f722
chore: 支持scrollToIndex
25263d7
chore: 支持反向索引映射
5f23489
Merge branch 'master' into feat-recycle-rn
cbd6b1b
feat: 优化小程序recycle
cd5100a
feat: 优化小程序recycle
18f8552
feat: 优化小程序recycle
be207ec
chore: 修改recycle注入逻辑
b8407da
chore: 修改rn组件注入条件
a7f38c6
chore: rn环境支持通过ref获取scrollToIndex方法
011f8e5
fix: wx recycle
3ee2cc6
chore: 调整wx组件结构
3a725d2
chore: del 无用md
bdfd315
Merge branch 'feat-sticky-rn' into feat-recycle-rn
2b04cc0
chore: 调整ali,web组件注入逻辑
68b60bf
Merge branch 'master' into feat-recycle-rn
b2f151d
feat: 支持 web sticky;
e575ba8
feat: 支持scrollToIndex
b7993c2
feat: 支持下拉刷新
548ac5e
feat: 支持list-header
51051ba
chore: 使用enableSticky作为标识
811658a
Merge branch 'feat-recycle-rn' into feat-recycle-sticky-web
5fcc341
chore: 优化组件注册逻辑
5305a48
feat: scrollToIndex支持viewPosition
eedc1fc
chore: 优化props类型
043752b
chore: 优化props类型
c366c40
chore: 优化props类型
2c801b1
Merge branch 'feat-recycle-rn' into feat-recycle-sticky-web
6eba2d4
chore: 优化props类型
8fc3515
chore: 优化组件注册逻辑
169e428
chore: 调整mpx-recycle-view目录
8f60230
chore: 调整mpx-recycle-view目录
3000d00
Merge branch 'feat-recycle-rn' into feat-recycle-sticky-web
570667f
Merge branch 'feat-sticky-rn' into feat-recycle-rn
a937a57
feat: init sticky ali
b7468e9
feat: init sticky ali
b0211f0
Merge branch 'feat-sticky-rn' into feat-recycle-rn
15895f3
Merge branch 'feat-sticky-rn' into feat-recycle-sticky-web
4c8cb27
Merge branch 'feat-sticky-rn' into feat-sticky-ali
2505b65
feat: 切换sticky吸附判断条件
1386c9e
fix: offsetTop导致吸附位置错误问题
deb6e01
feat: ali环境支持sticky-section
f7d80fa
Merge branch 'feat-sticky-rn' into feat-recycle-rn
e8732eb
Merge branch 'feat-recycle-rn' into feat-sticky-ali
c633673
chore: ali 支持recycle-view
e59c1cd
chore: 优化recycle-view
02dfc1f
chore: 优化sticky
47807f1
Merge branch 'master' into feat-sticky-ali
ccc8ac5
chore: 优化recyle
9bea494
chore: 优化recyle
d104685
chore: 修改recycle-view ref 获取返回值
9e15b94
Merge branch 'feat-recycle-rn' into feat-sticky-ali
e75566a
chore: 补充ali环境EXTEND_COMPONENTS_LIST
d77cc56
chore: 补充ali环境EXTEND_COMPONENTS_LIST
3d32435
Merge branch 'feat-recycle-rn' into feat-sticky-ali
55fcfac
Merge branch 'feat-recycle-rn' into feat-recycle-sticky-web
e423ba8
chore: 优化sticky-header
c9f2aad
chore: 添加轮询修正逻辑
bd54ba0
chore: 添加轮询修正逻辑
6e2262d
Merge branch 'master' into feat-recycle-rn
8053a33
Merge branch 'master' into feat-recycle-sticky-web
bc953eb
Merge branch 'master' into feat-sticky-ali-v2
69ea628
chore: 优化refresh逻辑
a178120
chore: 优化handleStickyStateChange逻辑
358058f
Merge branch 'master' into feat-recycle-rn
23312fb
chore: cr修改
2adde6e
refactor: flatlist替换为sectionlist
5c8cfd7
feat: 拓展组件注册考虑单组件输出
f6d519e
chore: 修改默认组件样式
6f10b44
Merge pull request #2224 from didi/feat-recycle-rn-cr
yandadaFreedom b197c4a
Merge branch 'master' into feat-recycle-rn
4e83ff6
feat: 新增end-reached-threshold属性
37751fc
feat: web增加原生组件titlebar&页面支持开启titlebar
mackwang112 efd114a
feat: web增加原生组件titlebar
mackwang112 9d945d8
Merge branch 'feat-recycle-rn' into feat-recycle-sticky-web
e659668
Merge branch 'master' into feat-recycle-sticky-web
9ea4fe4
fix: web recycle-view 格式与其他平台拉齐
6a7d6ba
Merge branch 'feat-recycle-rn' into feat-sticky-ali-v2
86f0ed8
Merge branch 'feat-recycle-sticky-web' into feat-sticky-ali-v2
7e604f0
chore: 修改web注册拓展组件逻辑
d2e1435
Merge branch 'feat-recycle-sticky-web' into feat-sticky-ali-v2
84d5b03
chore: 优化ali环境recyle-view渲染逻辑
996ff5d
docs: 补充recycle-view文档
8705b49
docs: 补充recycle-view文档
f7bf9cc
docs: 补充recycle-view文档
186aba6
docs: 补充文档
1878280
docs: 补充文档
e331c77
fix: 外层容器定高,recycle-view无法滚动问题
e975878
Merge branch 'feat-recycle-sticky-web' into feat-sticky-ali-v2
b9ba9d1
docs: 补充文档
4eef437
Merge branch 'master' into feat-sticky-ali-v2
d2afd25
Merge branch 'master' into feat-recycle-rn
5d48042
fix: lint error
30bb85d
chore: 修改useListHeader默认值
15831f6
chore: 修改useListHeader默认值
71407a0
chore: 修改useListHeader默认值
5b6f2ca
docs: 补充文档
e0c4401
docs: 修改文档
197708c
fix: 动态修改height相关配置,重新触发getItemLayout计算
87c50a2
fix: sectionList 重新渲染导致list-item、list-header 等组件 销毁并重新创建;
5b5d2d2
Merge pull request #2404 from didi/feat-sticky-ali-v2-cr
yandadaFreedom c097ef3
feat: 修复recycle-view组件渲染导致item等组件销毁重建&支持list-footer节点
5ca823b
fix: conflict;
1655db9
feat: wx & web支持list-footer节点&支持itemHeight等高度动态变化
8be6bc2
feat: ali支持list-footer节点&支持itemHeight等高度动态变化
2388fd4
feat: scrollToIndex 支持 viewOffset参数
1de2850
refactor: 重构拓展组件引用机制
c57abd7
feat: 新增通过key复用dom机制,https://
1a5507f
refactor: 修改sticky相关组件注册机制
ca7772c
Merge branch 'master' into feat-sticky-ali-v2
e798421
feat: add defult generics component
fbe97cf
chore: rename recycle-list
e491f1b
fix: lint error
3d4109d
feat: 添加拓展组件占位文件
71fe3bc
Merge branch 'master' into feat-sticky-ali-v2
539e691
v2.10.18-beta.1
Blackgan3 8bece5f
fix: 修复strip-conditional条件执行问题
Blackgan3 6119657
v@mpxjs/webpack-plugin@2.10.18-beta.2
Blackgan3 fc04808
fix(input): 修复输入框特定失焦场景
wangshunnn 749e3d3
v@mpxjs/webpack-plugin@2.10.18-beta.3
Blackgan3 9bdf8c0
Merge branch 'master' into feat-sticky-ali-v2
645f6e3
Merge pull request #2434 from didi/fix-drn-2.10.18-input
Blackgan3 a61c4f5
v2.10.18-beta.4
Blackgan3 587b687
del transform sort
wenwenhua c2b34ac
Merge pull request #2446 from didi/fix-drn-2.10.18-transform-order
Blackgan3 73318de
v@mpxjs/webpack-plugin@2.10.18-beta.5
Blackgan3 d3f0415
fix(pircker-view): sync offsetYShared with itemRawH for correct wheel…
wangshunnn 2e1619a
Merge pull request #2447 from didi/fix-drn-2.10.18-picker-view
Blackgan3 7b73471
v:@mpxjs/webpack-plugin@2.10.18-beta.6
Blackgan3 ccd984b
v@mpxjs/webpack-plugin@2.10.18-beta.7
Blackgan3 41cda93
v:2.10.18-beta.8
Blackgan3 7717b2e
add transition duration
wenwenhua 8049df8
transition 更新
wenwenhua a8d9f3a
Merge branch 'master' into feat-sticky-ali-v2
4414326
v@mpxjs/webpack-plugin@2.10.18-beta.5
Blackgan3 177bd51
fix(pircker-view): sync offsetYShared with itemRawH for correct wheel…
wangshunnn c3087f7
v:@mpxjs/webpack-plugin@2.10.18-beta.6
Blackgan3 cde9ebb
v@mpxjs/webpack-plugin@2.10.18-beta.7
Blackgan3 615128b
v:2.10.18-beta.8
Blackgan3 252cce0
fix: 修复首页 global.__mpxEnterOptions.query 取值异常
mackwang112 f056da6
fix: 修复首页 global.__mpxEnterOptions.query 取值异常
mackwang112 8b46090
@mpxjs/core@2.10.18-beta.3
mackwang112 a1daa7a
[feat]remove asyncChunk timeout
CommanderXL 19bf204
Merge pull request #2464 from didi/fix-drn-2.10.18-remove-asyncChunk-…
Blackgan3 ccbe5f2
Merge remote-tracking branch 'origin/fix-drn-2.10.18' into fix-drn-2.…
Blackgan3 3aadee6
v2.10.18-beta.8
Blackgan3 87d0219
Merge tag 'v2.10.18' into feat-web-title-bar
mackwang112 9aefe2f
fix: 移除注释
mackwang112 7fbd966
docs: 补充mpx.config.webConfig.enableTitleBar文档
mackwang112 dc38e11
Merge branch 'feat-web-title-bar' into fix-drn-2.10.18
mackwang112 bcfa42d
@mpxjs/webpack-plugin@2.10.18-beta.10
mackwang112 5fc72bf
web title bar
mackwang112 6438d0f
Merge branch 'fix-drn-2.10.18' into feat-web-title-bar
mackwang112 1bf20f5
feat: sectionList 支持手势协同
9bc8729
feat: 删除无用组件配置
4b5a554
feat: 删除无用组件配置
e4471e4
Merge branch 'feat-sticky-ali-v2' into feat-section-list-gesuture
1d74d32
update
wenwenhua 2f98207
Merge branch 'fix-drn-2.10.18' into fix-drn-2.10.18-transition
wenwenhua d537b8a
add transition duration
wenwenhua ef2fb6d
Merge pull request #2458 from didi/fix-drn-2.10.18-transition
Blackgan3 635106e
@mpxjs/webpack-plugin@2.10.18-beta.11
mackwang112 2fb1125
Merge branch 'feat-web-title-bar' into fix-drn-2.10.18
mackwang112 de6f0b1
vbeta
Blackgan3 23fc767
支持observe可以传入refs
6d01e6b
Merge pull request #2477 from didi/feat-2.10.18-observerefs
Blackgan3 0dba55b
Merge remote-tracking branch 'origin/fix-drn-2.10.18' into fix-drn-2.…
Blackgan3 6c8110f
v@mpxjs/api-proxy@2.10.18-beta.12
Blackgan3 d2124a0
Merge branch 'master' into feat-sticky-ali-v2
7a82958
chore: 修复变量命名等问题
df1f636
Merge branch 'master' into fix-drn-2.10.18
Blackgan3 c05cbbc
Merge branch 'master' into feat-sticky-ali-v2
75b3a9c
Merge branch 'fix-drn-2.10.18' into feat-sticky-ali-v2
yandadaFreedom cb6adac
Merge branch 'master' into feat-sticky-ali-v2
3a9ddb8
Merge branch 'feat-sticky-ali-v2' of https://github.com/didi/mpx into…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| # Mpx 扩展组件 | ||
|
|
||
| 除基础组件外,Mpx 额外提供一些扩展组件。扩展组件需开发者在 `mpx.config.js`中通过编译配置`useExtendComponents`按需注册,注册成功后即可作为全局自定义组件使用。 | ||
| ```js | ||
| // mpx.config.js | ||
| defineConfig({ | ||
| pluginOptions: { | ||
| mpx: { | ||
| plugin: { | ||
| useExtendComponents: { | ||
| wx: ["recycle-view"], | ||
| ali: ["recycle-view"], | ||
| web: ["recycle-view"], | ||
| ios: ["recycle-view"], | ||
| android: ["recycle-view"], | ||
| harmony: ["recycle-view"] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }) | ||
| ``` | ||
|
|
||
|
|
||
| ## recycle-view | ||
|
|
||
| 跨端虚拟列表组件,可自定义分组头、列表头、列表项,自动分段渲染兼容各端。 | ||
|
|
||
| 支持平台:微信小程序、支付宝小程序、Web、RN | ||
|
|
||
| ### 属性 | ||
|
|
||
| | 属性名 | 类型 | 默认值 | 说明 | 支持平台 | | ||
| |-----------------------|-------------|----------|------------------------|-----------| | ||
| | height | String/Number | 100% | 组件高度 | 全平台 | | ||
| | width | String/Number | 100% | 组件宽度 | 全平台 | | ||
| | listData | Array | [] | 列表数据,如需使用列表分组头 `section-header`,对应 item 的数据需要包含 `isSectionHeader: true` 标识 | 全平台 | | ||
| | enable-sticky | Boolean | false | 启用分组吸顶 | 全平台<br>⚠️微信小程序环境,需要使用 skyline 渲染模式,webview 模式不支持;web 环境仅支持移动端,不支持 pc 端 | | ||
| | scroll-with-animation | Boolean | false | 滚动动画 | 全平台 | | ||
| | generic:recycle-item | string | | 列表项,抽象节点组件名,对应组件需要通过 usingComponents 注册 | 全平台 | | ||
| | generic:section-header | string | | 列表分组头,抽象节点组件名,对应组件需要通过 usingComponents 注册 | 全平台 | | ||
| | generic:list-header | string | | 列表头,抽象节点组件名,对应组件需要通过 usingComponents 注册 | 全平台 | | ||
| | useListHeader | Boolean | false | 使用自定义列表头 | 全平台 | | ||
| | listHeaderData | Object | {} | 列表头数据 | 全平台 | | ||
| | itemHeight | Object | {} | 列表项高度配置(支持 getter/value),必须配置 | 全平台 | | ||
| | sectionHeaderHeight | Object | {} | 分组头部高度配置(getter/value),若使用了自定义分组头必须配置 | 全平台 | | ||
| | listHeaderHeight | Object | {} | 列表头部高度配置(getter/value),若使用了列表头必须配置 | 全平台 | | ||
| | bufferScale | Number | 1 | 渲染缓冲区行数(虚拟滚动优化) | 仅支付宝小程序/web支持 | | ||
| | minRenderCount | Number | 10 | 最小渲染项目数 | 仅支付宝小程序/web支持 | | ||
|
|
||
| #### `itemHeight`/`sectionHeaderHeight`/`listHeaderHeight` 格式说明 | ||
|
|
||
| 高度相关属性支持如下格式: | ||
|
|
||
| ```js | ||
| height: { | ||
| value: 400, // 定高 | ||
| getter: function (item, index) { | ||
| const seed = item.id % 2 || 0 | ||
| const heights = [100, 300] | ||
| return heights[seed] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **说明:** | ||
| - `value`:默认高度(所有项相同高度时直接用 value 即可)。 | ||
| - `getter`:函数形式,可接收每一项的数据和索引,按需返回不同高度(动态高度需求时使用)。 | ||
| - `getter` 优先级 大于 value。 | ||
|
|
||
| > 建议性能要求较高(如超大数据集)优先使用 `value` 定高。 | ||
|
|
||
| ### 事件 | ||
|
|
||
| | 事件名 | 说明 | 支持平台 | | ||
| |-----------------------|-----------------------------------|--------------| | ||
| | bindscroll | 滚动时触发,返回滚动信息 | 全平台 | | ||
| | bindscrolltolower | 滚动到底部/触底通知 | 全平台 | | ||
| | bindscrollToIndex | 组件方法,滚动到指定索引 | 全平台 | | ||
|
|
||
| `scrollToIndex({ index, animated, viewPosition })` 参数说明: | ||
| - `index`:目标索引 | ||
| - `animated`:是否滚动动画 | ||
| - `viewPosition`:滚动定位,0:顶部, 0.5:中间, 1:底部 | ||
|
|
||
| ### 用法示例 | ||
|
|
||
| ```js | ||
| <recycle-view | ||
| generic:recycle-item="normal-recycle-item" | ||
| generic:section-header="section-header" | ||
| generic:list-header="list-header" | ||
| width="{{width}}" | ||
| height="{{height}}" | ||
| listData="{{dataList}}" | ||
| itemHeight="{{ itemHeight }}" | ||
| sectionHeaderHeight="{{headerHeight}}" | ||
| listHeaderHeight="{{listHeaderHeight}}" | ||
| bufferScale="{{bufferScale}}" | ||
| useListHeader="{{true}}" | ||
| enable-sticky="{{true}}" | ||
| /> | ||
| <script> | ||
| import mpx, { createPage, createComponent } from '@mpxjs/core' | ||
|
|
||
| const generateData = (itemsPerSection) => { | ||
| const data = [] | ||
|
|
||
| for (let i = 0; i < 10; i++) { | ||
| data.push({ | ||
| isSectionHeader: true, // 标识该行使用 section-header 对应的抽象节点渲染 | ||
| title: `Section ${i + 1}` | ||
| }) | ||
|
|
||
| // 添加该 section 的 items | ||
| for (let j = 0; j < itemsPerSection; j++) { | ||
| const itemNumber = i * itemsPerSection + j + 1 | ||
| data.push({ | ||
| id: itemNumber, | ||
| title: `Item ${itemNumber}`, | ||
| description: `This is item number ${itemNumber} in section ${i + 1}` | ||
| }) | ||
| } | ||
| } | ||
| return data | ||
| } | ||
|
|
||
| createPage({ | ||
| data: { | ||
| width: 0, | ||
| height: 0, | ||
| bufferScale: 5, | ||
| dataList: generateData(100), | ||
| itemHeight: { | ||
| getter: function (item, index) { | ||
| const seed = item.id % 2 || 0 | ||
| const heights = [100, 300] | ||
| return heights[seed] | ||
| } | ||
| }, | ||
| headerHeight: { | ||
| value: 50 | ||
| }, | ||
| listHeaderHeight: { | ||
| value: 100 | ||
| } | ||
| }, | ||
| onLoad() { | ||
| this.height = mpx.getWindowInfo().windowHeight | ||
| this.width = mpx.getWindowInfo().windowWidth | ||
| } | ||
| }) | ||
| </script> | ||
| <script type="application/json"> | ||
| { | ||
| "usingComponents": { | ||
| "normal-recycle-item": "@/components/recycle-item", | ||
| "section-header": "@/components/section-header", | ||
| "list-header": "@/components/list" | ||
| } | ||
| } | ||
| </script> | ||
| ``` | ||
|
|
||
| ### 其它说明 | ||
|
|
||
| - 当使用了列表项、列表头或者自定义分组头,必须配置对应 item/sectionHeader/listHeader 的 height 相关参数,否则会出现滚动异常情况。 | ||
| - 可直接调用 ref 实例执行 `scrollToIndex` 方法实现滚动。 | ||
| - 如果用户滑动的速度超过渲染的速度,则会先看到空白的内容,这是为了长列表优化不得不作出的妥协。 | ||
| - 当某行滑出渲染区域之外后,其内部状态将不会保留。 | ||
| - 在 RN 环境,recycle-view 通过 RN 提供的 SectionList 实现分组吸顶。受 RN 底层实现机制限制,开启 `enable-sticky` 且快速滑动时,自定义分组头有时会出现闪烁现象。此问题需要等待 RN 官方修复,我们会持续关注并跟进。 | ||
| - 若某行需要使用 `section-header` 对应的抽象节点渲染,则该行数据必须包含 `isSectionHeader: true` 字段;否则默认使用 `recycle-item` 对应的抽象节点渲染 | ||
|
|
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ const createJSONHelper = require('./helper') | |
| const RecordIndependentDependency = require('../dependencies/RecordIndependentDependency') | ||
| const RecordRuntimeInfoDependency = require('../dependencies/RecordRuntimeInfoDependency') | ||
| const { MPX_DISABLE_EXTRACTOR_CACHE, RESOLVE_IGNORED_ERR, JSON_JS_EXT } = require('../utils/const') | ||
| const { processExtendComponents } = require('../utils/process-extend-components') | ||
| const resolve = require('../utils/resolve') | ||
| const resolveTabBarPath = require('../utils/resolve-tab-bar-path') | ||
| const resolveMpxCustomElementPath = require('../utils/resolve-mpx-custom-element-path') | ||
|
|
@@ -75,13 +76,17 @@ module.exports = function (content) { | |
| const { getRequestString } = createHelpers(this) | ||
|
|
||
| let currentName | ||
|
|
||
| let hasApp = true | ||
| if (isApp) { | ||
| currentName = appInfo.name | ||
| } else { | ||
| currentName = componentsMap[resourcePath] || pagesMap[resourcePath] | ||
| } | ||
|
|
||
| if (!appInfo.name) { | ||
| hasApp = false | ||
| } | ||
|
|
||
| const relativePath = useRelativePath ? publicPath + path.dirname(currentName) : '' | ||
|
|
||
| const copydir = (dir, context, callback) => { | ||
|
|
@@ -160,6 +165,18 @@ module.exports = function (content) { | |
| json.usingComponents = json.usingComponents || {} | ||
| } | ||
|
|
||
| if (mode === 'wx' || mode === 'ali') { | ||
| const { useExtendComponents = {} } = mpx | ||
| if ((isApp || !hasApp) && useExtendComponents[mode]) { | ||
| const extendComponents = processExtendComponents({ | ||
| useExtendComponents, | ||
| mode, | ||
| emitWarning | ||
| }) | ||
| json.usingComponents = Object.assign({}, extendComponents, json.usingComponents) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这段逻辑感觉有点难维护,当前应该就遗漏了preprocessjson中的,要不然让用户自己注册使用吧 |
||
| } | ||
| } | ||
|
|
||
| // 快应用补全json配置,必填项 | ||
| if (mode === 'qa' && isApp) { | ||
| const defaultConf = { | ||
|
|
||
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const hasApp = !!appInfo.name 不就可以了