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

支持draggable #61

Closed
wants to merge 2 commits into from
Closed

Conversation

wuguanghai45
Copy link

用react-draggable包了一下

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6fffe34 on wuguanghai45:master into ** on react-component:master**.

@silentcloud
Copy link
Member

搞成按需加载吧,不然又增加大小了

@wuguanghai45
Copy link
Author

@silentcloud
技术不够,无法实现按需加载。有没有相关文章推荐一下。
异步加载需要webpack配置支持。

可以考虑更改使用draggable的方式, 将content wrap可配

import React from 'react';
import ReactDOM from 'react-dom';
import Draggable from 'react-draggable';
import Dialog from 'rc-dialog';

ReactDOM.render(
  <Dialog contentWrap={<Draggable />}>
    <div style={{ height: 200 }}></div>
  </Dialog>,
  document.getElementById('__react-content'),
);

@silentcloud
Copy link
Member

@wuguanghai45 draggable 的方式单独拆分一个 component 出来,需要使用 draggable 特性的,自行引入 draggable component,意思就是说 draggable 不侵入 Dialog.tsx

@wuguanghai45
Copy link
Author

wuguanghai45 commented Jul 13, 2017

@silentcloud 那就是我举例的这种方法了。

import React from 'react';
import ReactDOM from 'react-dom';
import Draggable from 'react-draggable';
import Dialog from 'rc-dialog';

ReactDOM.render(
  <Dialog contentWrap={<Draggable />}>
    <div style={{ height: 200 }}></div>
  </Dialog>,
  document.getElementById('__react-content'),
);

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

Successfully merging this pull request may close these issues.

None yet

3 participants