-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: toast修改完成 * test: update snapshots --------- Co-authored-by: anlyyao <[email protected]>
- Loading branch information
Showing
20 changed files
with
281 additions
and
489 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 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,41 @@ | ||
<template> | ||
<div class="toast-demo"> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showText()">纯文本</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showMultiText()">多行文字</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showHorizontalText()">带横向图标</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showVerticalText()">带竖向图标</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showLoading()">加载状态</t-button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { h, ref } from 'vue'; | ||
import { Toast } from 'tdesign-mobile-vue'; | ||
const showText = () => { | ||
Toast('轻提示文字内容'); | ||
}; | ||
const showMultiText = () => { | ||
Toast('最多一行展示十个汉字宽度限制最多不超过三行文字行文字行文字'); | ||
}; | ||
const showHorizontalText = () => { | ||
Toast({ | ||
theme: 'success', | ||
direction: 'row', | ||
message: '轻提示文字内容', | ||
}); | ||
}; | ||
const showVerticalText = () => { | ||
Toast({ | ||
theme: 'success', | ||
direction: 'column', | ||
message: '轻提示文字内容', | ||
}); | ||
}; | ||
const showLoading = () => { | ||
Toast({ | ||
theme: 'loading', | ||
message: '轻提示文字内容', | ||
}); | ||
}; | ||
</script> |
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,25 @@ | ||
<template> | ||
<div class="toast-demo"> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showOverlay">显示提示</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="hideToast">关闭提示</t-button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { Toast } from 'tdesign-mobile-vue'; | ||
const showOverlay = () => { | ||
Toast({ | ||
message: '未知点击事件', | ||
onClose: () => { | ||
console.log('onClose'); | ||
}, | ||
onDestroy: () => { | ||
console.log('onDestroy'); | ||
}, | ||
}); | ||
}; | ||
const hideToast = () => { | ||
Toast.clear(); | ||
}; | ||
</script> |
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 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 was deleted.
Oops, something went wrong.
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,35 @@ | ||
<template> | ||
<div class="toast-demo"> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showSuccessToast()">成功提示</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showWarningToast()">警告提示</t-button> | ||
<t-button block size="large" theme="primary" variant="outline" @click="showErrorToast()">错误提示</t-button> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { h, ref } from 'vue'; | ||
import { Toast } from 'tdesign-mobile-vue'; | ||
import { ErrorCircleIcon } from 'tdesign-icons-vue-next'; | ||
const showSuccessToast = () => { | ||
Toast({ | ||
theme: 'success', | ||
direction: 'column', | ||
message: '轻提示文字内容', | ||
}); | ||
}; | ||
const showWarningToast = () => { | ||
Toast({ | ||
icon: () => h(ErrorCircleIcon), | ||
direction: 'column', | ||
message: '轻提示文字内容', | ||
}); | ||
}; | ||
const showErrorToast = () => { | ||
Toast({ | ||
theme: 'error', | ||
direction: 'column', | ||
message: '轻提示文字内容', | ||
}); | ||
}; | ||
</script> |
Oops, something went wrong.