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

refactor Progress component #501

Closed
36 tasks done
wind13 opened this issue Dec 16, 2020 · 0 comments · Fixed by #533
Closed
36 tasks done

refactor Progress component #501

wind13 opened this issue Dec 16, 2020 · 0 comments · Fixed by #533
Assignees
Labels
refactor Refactor old code

Comments

@wind13
Copy link
Contributor

wind13 commented Dec 16, 2020

Tasking

  • 阅读Vue 组合式 API文档
  • Folk 项目并配置本地开发环境及工具等: VSCode 及插件:Vetur, ESLint, Prettier, Vue VSCode Snippets
  • 阅读【element3-开发日记】手摸手教你重写 Button 组件
  • 线形进度条
    • 通过 <el-progress :percentage="50"></el-progress> 定义一个默认的 Progress 组件
    • 通过 props.percentage 控制 Progress 组件的百分比
      • 实现传入参数的校验功能
    • 通过 props.format 自定义 Progress 组件进度条中文字的格式化方法
    • 通过 props.color 自定义 Progress 组件的颜色
      • 实现传入字符串改变颜色
      • 实现传入函数改变颜色
      • 实现传入数组改变颜色
    • 通过 props.status 控制 Progress 组件的状态和颜色
      • 实现 status 初始化或变化后添加或修改相应的class样式
      • 实现 status 引起 icon 的变化
    • 通过 props.showText 自定义 Progress 组件是否显示文字
    • 通过 props.strokeWidth 自定义 Progress 组件进度条的高度
      • 进度条高度变化后,显示文字大小随着相应变化。(经测试效果不如不变,故不实现了。)

==> 字体大小不随进度条宽度变化:

==> 字体大小随着进度条宽度变化:

  • 通过 props.textInside 自定义 Progress 组件的文字是否显示在进度条内
  • 通过 props.type 控制 Progress 组件的显示类型
  • 环型进度条
    • 实现环型进度条基本 HTML 和样式,初步实现环形进度条显示
    • 通过 props.width 自定义环形进度条的宽度
    • 修改 percentage 显示环形相应变化
    • 通过 props.strokeLinecap 自定义 Progress 组件进度条的形状
    • 文字显示在环形中间
    • 显示正确的状态和颜色
    • icon 换成不带外圈的,字体调大为 16px
  • 仪表盘形进度条
  • Code review
    • 删除 jsconfig.json
    • 使用 jest-vtu 里面的方法替换测试方法
      • assertExistsElem 可以使用 toBeExist
      • 验证 attributes 可以使用 toHaveAttribute
    • 使用 lodash-es 替换 lodash
    • 使用 toHaveTextContent 替换 assertContainText
@cuixiaorui cuixiaorui added the refactor Refactor old code label Dec 16, 2020
@wind13 wind13 self-assigned this Dec 30, 2020
cuixiaorui added a commit that referenced this issue Jan 2, 2021
refactor(Progress): #501 Done refactor Progress component
@cuixiaorui cuixiaorui linked a pull request Jan 2, 2021 that will close this issue
wind13 added a commit that referenced this issue Jan 27, 2021
wind13 added a commit that referenced this issue Jan 28, 2021
wind13 added a commit that referenced this issue Jan 28, 2021
wind13 added a commit that referenced this issue Jan 28, 2021
cuixiaorui added a commit that referenced this issue Jan 28, 2021
refactor(Progress): #501 Change file from js to ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Refactor old code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants