更新记录
1.0.0(2024-09-18)
初次发布
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 4.24,Android:4.4,iOS:不确定,HarmonyNext:不确定 |
× |
× |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
示例代码
Template
<template>
<view class="area">
<button class="btn" @click="ok">成功</button>
<button class="btn" @click="err">失败</button>
<button class="btn" @click="info">提示</button>
<button class="btn" @click="loading">loading</button>
<button class="btn" @click="Hideloading">关闭loading</button>
</view>
</template>
```Script
<script>
import { uyToast, ToastOptions, uyLoading, uyHideLoading } from "@/uni_modules/uy-toast"
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
ok() {
uyToast({
title: 'غەلبىلىك بولدى',
icon: 'success',
complete() {
console.log('成功')
}
} as ToastOptions)
},
err() {
uyToast({
title: 'ئۇچۇر خاتا',
icon: 'error',
complete() {
console.log('错误')
}
} as ToastOptions)
},
info() {
uyToast({
title: 'ئاۋال كىرىڭ',
icon: 'info',
complete() {
console.log('提示')
}
} as ToastOptions)
},
loading() {
uyLoading()
},
Hideloading() {
uyHideLoading()
}
}
}
</script>
```Style
<style>
.area {
flex: 1;
padding: 20rpx;
justify-content: center;
}
.btn {
background: crimson;
color: white;
border-radius: 100rpx;
border: none;
margin-bottom: 30rpx;
}
</style>