mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
60 lines
1018 B
JavaScript
60 lines
1018 B
JavaScript
const Toast = require('../../dist/toast/toast');
|
|
|
|
Page({
|
|
data: {},
|
|
|
|
showToast() {
|
|
Toast.setDefaultOptions({
|
|
selector: '#van-toast-test'
|
|
});
|
|
|
|
Toast('toast的内容');
|
|
},
|
|
|
|
showIconToast() {
|
|
Toast({
|
|
type: 'fail',
|
|
message: 'toast的内容',
|
|
selector: '#van-toast-test'
|
|
});
|
|
},
|
|
|
|
showImageToast() {
|
|
Toast({
|
|
message: 'toast的内容',
|
|
selector: '#van-toast-test',
|
|
image: 'https://b.yzcdn.cn/v2/image/dashboard/secured_transaction/suc_green@2x.png'
|
|
});
|
|
},
|
|
|
|
showLoadingToast() {
|
|
Toast({
|
|
type: 'loading',
|
|
message: 'toast的内容',
|
|
selector: '#van-toast-test'
|
|
});
|
|
},
|
|
|
|
showOnlyIcon() {
|
|
Toast({
|
|
type: 'fail',
|
|
selector: '#van-toast-test'
|
|
});
|
|
},
|
|
|
|
showEverToast() {
|
|
Toast({
|
|
message: 'toast的内容',
|
|
selector: '#van-toast-test',
|
|
timeout: -1
|
|
});
|
|
},
|
|
|
|
showLoading() {
|
|
Toast.loading({
|
|
message: '加载中',
|
|
selector: '#van-toast-test'
|
|
});
|
|
}
|
|
});
|