-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(drag): demo拆解与规范 * chore(tag): demo * fix: update
- Loading branch information
Showing
14 changed files
with
264 additions
and
531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import { Drag, Button } from '@nutui/nutui-react' | ||
|
||
const Demo1 = () => { | ||
return ( | ||
<Drag style={{ top: '120px', left: '24px' }}> | ||
<Button type="primary">drag</Button> | ||
</Drag> | ||
) | ||
} | ||
export default Demo1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react' | ||
import { Drag, Button } from '@nutui/nutui-react' | ||
|
||
const Demo2 = () => { | ||
return ( | ||
<> | ||
<Drag direction="x" style={{ top: '200px', left: '24px' }}> | ||
<Button type="primary">X</Button> | ||
</Drag> | ||
<Drag direction="y" style={{ top: '200px', right: '50px' }}> | ||
<Button type="primary">Y</Button> | ||
</Drag> | ||
</> | ||
) | ||
} | ||
export default Demo2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import { Drag, Button } from '@nutui/nutui-react' | ||
|
||
const Demo3 = () => { | ||
return ( | ||
<Drag direction="x" attract style={{ top: '275px', left: '0px' }}> | ||
<Button type="primary">attract</Button> | ||
</Drag> | ||
) | ||
} | ||
export default Demo3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
import { Drag, Button } from '@nutui/nutui-react' | ||
|
||
const Demo4 = () => { | ||
const right = () => { | ||
return document.documentElement.clientWidth - 300 - 9 | ||
} | ||
const bottom = () => { | ||
return document.documentElement.clientHeight - 559 | ||
} | ||
return ( | ||
<> | ||
<div | ||
className="drag-boundary" | ||
style={{ | ||
position: 'absolute', | ||
top: '360px', | ||
left: '8px', | ||
width: '300px', | ||
height: '200px', | ||
border: '1px solid var(--nutui-color-primary)', | ||
}} | ||
/> | ||
<Drag | ||
boundary={{ top: 361, left: 9, bottom: bottom(), right: right() }} | ||
style={{ top: '400px', left: '50px' }} | ||
> | ||
<Button type="primary">boundary</Button> | ||
</Drag> | ||
</> | ||
) | ||
} | ||
export default Demo4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import { Drag, Button } from '@nutui/nutui-react-taro' | ||
|
||
const Demo1 = () => { | ||
return ( | ||
<Drag style={{ left: '8px' }}> | ||
<Button type="primary">drag</Button> | ||
</Drag> | ||
) | ||
} | ||
export default Demo1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react' | ||
import { Drag, Button } from '@nutui/nutui-react-taro' | ||
|
||
const Demo2 = () => { | ||
return ( | ||
<> | ||
<Drag | ||
direction="x" | ||
style={{ | ||
top: '200px', | ||
left: '8px', | ||
}} | ||
> | ||
<Button type="primary">X</Button> | ||
</Drag> | ||
<Drag | ||
direction="y" | ||
style={{ | ||
top: '200px', | ||
right: '50px', | ||
}} | ||
> | ||
<Button type="primary">Y</Button> | ||
</Drag> | ||
</> | ||
) | ||
} | ||
export default Demo2 |
Oops, something went wrong.