-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into refactor_cell
refactor(cell): update-snapshot
- Loading branch information
Showing
16 changed files
with
489 additions
and
120 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
Submodule _common
updated
5 files
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,42 @@ | ||
import React, { useState, useCallback } from 'react'; | ||
import { BackTop, Button } from 'tdesign-mobile-react'; | ||
import './style/index.less'; | ||
|
||
export default function Base({ visible, onClose, container }) { | ||
const [theme, setTheme] = useState({ | ||
theme: 'round', | ||
text: '顶部', | ||
}); | ||
|
||
// 切换主题 | ||
const onClick = useCallback( | ||
(theme, text) => { | ||
setTheme({ | ||
theme, | ||
text, | ||
}); | ||
onClose(); | ||
const containerElement = container(); | ||
containerElement.scrollTop = 1200; | ||
}, | ||
[onClose, container], | ||
); | ||
|
||
function handleToTop() { | ||
console.log('handleToTop'); | ||
} | ||
|
||
return ( | ||
<> | ||
{visible ? <BackTop text={theme.text} theme={theme.theme} onToTop={handleToTop} container={container} /> : null} | ||
<div className="button-group"> | ||
<Button className="button" variant="outline" theme="primary" onClick={() => onClick('round', '顶部')}> | ||
圆形返回顶部 | ||
</Button> | ||
<Button className="button" variant="outline" theme="primary" onClick={() => onClick('half-round', '返回顶部')}> | ||
半圆形返回顶部 | ||
</Button> | ||
</div> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.tdesign-mobile-react-demo { | ||
background: #fff; | ||
overflow: auto; | ||
height: 100vh; | ||
|
||
.button-group { | ||
display: flex; | ||
|
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,19 @@ | ||
:: BASE_DOC :: | ||
|
||
## API | ||
|
||
|
||
### BackTop Props | ||
|
||
name | type | default | description | required | ||
-- | -- | -- | -- | -- | ||
className | String | - | className of component | N | ||
style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProperties` | N | ||
container | Function | - | Typescript:`() => HTMLElement` | N | ||
fixed | Boolean | true | \- | N | ||
icon | TNode | true | Typescript:`boolean \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N | ||
target | Function | - | Typescript:`() => HTMLElement` | N | ||
text | String | '' | \- | N | ||
theme | String | round | options: round/half-round/round-dark/half-round-dark | N | ||
visibilityHeight | Number | 200 | \- | N | ||
onToTop | Function | | Typescript:`() => void`<br/> | N |
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
Oops, something went wrong.