Skip to content
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

[comp: card]feature card component #28

Closed
1 task done
CruellyJoHn opened this issue Dec 17, 2020 · 4 comments
Closed
1 task done

[comp: card]feature card component #28

CruellyJoHn opened this issue Dec 17, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@CruellyJoHn
Copy link
Contributor

CruellyJoHn commented Dec 17, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

  • 支持设置卡片大小
  • 支持设置卡片边框的显示
  • 支持title自定义
  • 支持卡片右上角操作区域自定义
  • 支持卡片loading状态
  • 支持卡片悬浮效果

What does the proposed API look like?

ix-card

参数 说明 类型 默认值 全局配置
title 卡片标题 `'string' 'slot'` -
extra 右上角操作区域 `'string' 'slot'` -
footer 卡片底部操作区域 'slot' - -
bordered 是否有边框 'booelan' 'true' 'true'
hoverable 是否悬浮 'booelan' 'false' 'false'
loading 当卡片内容还在加载中时,可以用 loading 展示一个占位 'booelan' 'false' 'false'
size 设置按钮大小 `'large' 'medium' 'small'`

事件

事件名称 说明 参数
onExtraClicked 当extra参数为string时,用于点击extra event
@CruellyJoHn CruellyJoHn added the enhancement New feature or request label Dec 17, 2020
@danranVm danranVm mentioned this issue Dec 17, 2020
95 tasks
@danranVm
Copy link
Member

@clfeng @danranVm 负责此组件的 review, API 设计完成后请 @ 他们

@danranVm danranVm added this to the v1.0.0 milestone Dec 25, 2020
@CruellyJoHn
Copy link
Contributor Author

@danranVm @clfeng 麻烦大佬review下

@danranVm
Copy link
Member

danranVm commented Jan 6, 2021

API 很克制,很棒。有几点建议:

  • onExtraClicked 不建议提供,如果用户有处理事件的需求,就使用 slot 好了, 传入 string 的时候,card 只负责展示。
  • bordered => borderless, 默认值为 false ,当然这个可能需要再次和大家确认一下, 理由是使用更为方便:
<ix-card borderless ></ix-card>
<!-- 而不是 -->
<ix-card :bordered="false" ></ix-card>

@clfeng
Copy link
Contributor

clfeng commented Jan 7, 2021

size 配置项的说明是指的卡片的大小吧?
当前api的配置项相对于antd来说是少了很多,个人觉得antd内置了很多的场景,这个我们可以后续考虑是否加上这些场景。然后再代码编写的时候可能要考虑的就是如果 以后要加上这些场景的话,代码是否好扩展

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants