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: BackTop] add BackTop component #79

Closed
1 task done
imguolao opened this issue Dec 28, 2020 · 6 comments · Fixed by #185
Closed
1 task done

[comp: BackTop] add BackTop component #79

imguolao opened this issue Dec 28, 2020 · 6 comments · Fixed by #185
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@imguolao
Copy link
Contributor

imguolao commented Dec 28, 2020

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

What problem does this feature solve?

  • 返回页面顶部的操作按钮

What does the proposed API look like?

Props

参数 说明 类型 默认值 全局配置 备注
target 需要监听其滚动事件的元素 string | HTMLElement window - 传入 string 类型,会在 mounted 的时候使用 querySelector 来获取元素
duration 回到顶部所需时间(ms) number 450 -
visibility-height 滚动高度达到此参数值才出现 number 400 -

Slots

名称 说明 参数类型 备注
defalut 自定义显示内容 - -

Emits

名称 说明 参数类型 备注
click 点击按钮触发的事件 event -
@imguolao imguolao added the enhancement New feature or request label Dec 28, 2020
@danranVm danranVm mentioned this issue Dec 28, 2020
95 tasks
@danranVm
Copy link
Member

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

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

@danranVm @huangtenghui 麻烦看一下 api 是否合理

@huangtenghui
Copy link

1、target 如果只支持string可能不太友好,应该也可以传dom;
2、visibility-height默认值应该是1吧,只要有滚动应该就得显示出来吧

@imguolao
Copy link
Contributor Author

1、target 如果只支持string可能不太友好,应该也可以传dom;
2、visibility-height默认值应该是1吧,只要有滚动应该就得显示出来吧

  1. 那 target 支持传入 string 和 HTMLElement
  2. visibility-height 默认为 1 的话,感觉会有点奇怪,至少也得滚动到半屏后,返回顶部这个功能才起作用,否则图标过早的出现似乎没什么意义

@huangtenghui
Copy link

1,target如果只支持字符串可能不太友好,应该也可以传dom;
2,visibility-height设置值应该是1吧,只要有滚动应该就得显示出来吧

  1. 那目标支持字符串和HTMLElement
  2. 能见度高度默认为1的话,感觉会有点奇怪,至少也得滚动到半屏后,返回顶部这个功能才起作用,否则图标过早的出现似乎没什么意义

ok

@danranVm
Copy link
Member

我没什么建议。

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

Successfully merging a pull request may close this issue.

3 participants