Ant-design: 后台目标无效

创建于 2017-06-05  ·  3评论  ·  资料来源: ant-design/ant-design

Version

2.10.4

Environment

mac ox 10.11.6、chrome 58.0.3029.110、antd 2.10.4

Reproduction link

https://codepen.io/cnchore/pen/KqwNjr

Steps to reproduce

  1. backtop target 绑定div ;
  2. 滚动 div,backtop可见,点击可返回顶部;

What is expected?

滚动 div,backtop可见,点击可返回顶部;

What is actually happening?

滚动 div,backtop不可见

所有3条评论

您的代码笔中的div甚至无法滚动!

https://codepen.io/anon/pen/yXyZqq?editors=0010

反应 15 更新 16.1.0

<BackToptarget={() => document.getElementById('backTop')}> <div> <Icon type="arrow-up" className='backTop' /> </div> </BackTop>
警告:道具target on 的值无效

标签。 要么将其从元素中移除,要么传递一个字符串或数值以将其保留在 DOM 中。 详情见https://fb.me/react-attribute-behavior
在 div 中(由 BackTop 创建)
在 AnimateChild 中(由 Animate 创建)
在 Animate 中(由 BackTop 创建)
在 BackTop 中(由 Product 创建)
在 div 中(由 BasicLayout 创建)
在 BasicLayout 中(由 Adapter 创建)
在适配器中(由产品创建)
在产品中
在未知中(由 Form(WrappedComponent) 创建)
在 Form(WrappedComponent) 中(由 RouterContext 创建)
在 div 中(由 BasicLayout 创建)
在 BasicLayout 中(由 Adapter 创建)
在适配器中(由 FirstPage 创建)
在 div 中(由 BasicLayout 创建)
在 BasicLayout 中(由 Adapter 创建)
在适配器中(由 FirstPage 创建)
在 div 中(由 FirstPage 创建)
在 FirstPage(由 Connect(FirstPage) 创建)
在 Connect(FirstPage) 中(由 RouterContext 创建)
在RouterContext(由Router创建)
在路由器中
在提供者

发生了什么?

得到同样的警告
image

在我看来target应该重命名为data-target以更好地适应客户属性命名约定。
该组件按预期工作

此页面是否有帮助?
0 / 5 - 0 等级