-
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.
* refactor(toast): update api * chore(toast): update snapshot * refactor(toast): use parseTNode * fix: fix cr --------- Co-authored-by: anlyyao <[email protected]>
- Loading branch information
Showing
26 changed files
with
820 additions
and
378 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 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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react'; | ||
import { Toast, Button } from 'tdesign-mobile-react'; | ||
|
||
export default function () { | ||
const onlyText = () => { | ||
Toast('轻提示文字内容'); | ||
}; | ||
|
||
const textMaxHeight = () => { | ||
Toast({ | ||
message: '最多一行展示十个汉字宽度限制最多不超过三行文字行文字行文字', | ||
}); | ||
}; | ||
|
||
const iconHori = () => { | ||
Toast({ message: '轻提示文字内容', theme: 'success' }); | ||
}; | ||
|
||
const iconColumn = () => { | ||
Toast({ message: '轻提示文字内容', theme: 'success', direction: 'column' }); | ||
}; | ||
|
||
const iconLoading = () => { | ||
Toast({ message: '轻提示文字内容', theme: 'loading' }); | ||
}; | ||
|
||
return ( | ||
<div className="toast-demo"> | ||
<Button block theme="primary" variant="outline" size="large" onClick={onlyText}> | ||
纯文本 | ||
</Button> | ||
|
||
<Button block theme="primary" variant="outline" size="large" onClick={textMaxHeight}> | ||
多行文字 | ||
</Button> | ||
|
||
<Button block theme="primary" variant="outline" size="large" onClick={iconHori}> | ||
带横向图标 | ||
</Button> | ||
|
||
<Button block theme="primary" variant="outline" size="large" onClick={iconColumn}> | ||
带竖向图标 | ||
</Button> | ||
|
||
<Button block theme="primary" variant="outline" size="large" onClick={iconLoading}> | ||
加载状态 | ||
</Button> | ||
</div> | ||
); | ||
} |
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,32 @@ | ||
import React from 'react'; | ||
import { Toast, Button } from 'tdesign-mobile-react'; | ||
|
||
export default function () { | ||
const showToast = () => { | ||
Toast({ | ||
message: '轻提示文字内容', | ||
onClose: () => { | ||
console.log('onClose'); | ||
}, | ||
onDestroy: () => { | ||
console.log('onDestroy'); | ||
}, | ||
}); | ||
}; | ||
|
||
const hideToast = () => { | ||
Toast.clear(); | ||
}; | ||
|
||
return ( | ||
<div className="toast-demo"> | ||
<Button block theme="primary" variant="outline" size="large" onClick={showToast}> | ||
显示提示 | ||
</Button> | ||
|
||
<Button block theme="primary" variant="outline" size="large" onClick={hideToast}> | ||
关闭提示 | ||
</Button> | ||
</div> | ||
); | ||
} |
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,24 @@ | ||
import React from 'react'; | ||
import { Toast, Button } from 'tdesign-mobile-react'; | ||
import { PoweroffIcon } from 'tdesign-icons-react'; | ||
|
||
export default function () { | ||
const showMssk = () => { | ||
Toast({ | ||
message: '禁止滑动和点击', | ||
direction: 'column', | ||
placement: 'bottom', | ||
duration: 5000, | ||
preventScrollThrough: true, | ||
showOverlay: true, | ||
icon: <PoweroffIcon />, | ||
}); | ||
}; | ||
return ( | ||
<div className="toast-demo"> | ||
<Button block theme="primary" variant="outline" size="large" onClick={showMssk}> | ||
禁止滑动和点击 | ||
</Button> | ||
</div> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.