Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
预设四大常用功能:分页、反馈、复制、朗读
Motivation
1.0 版本的 Actions 仅实现了一些基础功能,用户想要使用一些常用功能也需要自己自定义很多内容,所以考虑在 2.0 对组件进行升级,预设若干高频常用功能,方便用户一键配置使用的同时,支持导出到外部场景使用
Detailed Design
Props
由于是对 items 进行预设配置,主要针对类型 ItemType 进行修改
在目前这 4 个预设内容的情况下,暂定入参修改如下
Custom render
对渲染内容进行修改,在原基础之上增加逻辑,优先对 type 进行特定渲染,原逻辑则作为兜底使用,伪代码如下
Component export
需要注意,这里目前共 4 个子组件,后续可能会进行扩展,相对较为复杂的部分例如 Feedback 最终会单独以子组件的形式导出,例如
Actions.Feedback
Example Usage
使用时,可以将 items 用 state 的方式传入,后续需要修改值的时候,使用 onChange 来触发,伪代码如下
0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions