精易论坛

标题: uni.app界面交互反馈之消息提示框 [打印本页]

作者: 石榴熟了    时间: 2021-12-9 20:11
标题: uni.app界面交互反馈之消息提示框

1.uni.showToast({}) 显示消息提示框。
常用属性:
title:页面提示的内容
image:改变提示框默认的icon图标
duration:提示框在页面显示多少秒才让它消失


<template>
    <view class="content">
        <button type="primary" @tap="addData">添加数据</button>
    </view>
</template>

<script>
    export default {
        methods: {
            addData:() => {
                uni.showToast({
                    title:"数据删除成功!",
                    duration:2000,
                    position:200,
                    image:"../../static/delete.png"
                })
            }
        }
    }
作者: Sir928    时间: 2021-12-10 09:51
严重水贴
作者: 石榴熟了    时间: 2021-12-10 10:22
Sir928 发表于 2021-12-10 09:51
严重水贴

没有 不水
很多人不知道 怎么加延迟
作者: Sir928    时间: 2021-12-10 11:02
石榴熟了 发表于 2021-12-10 10:22
没有 不水
很多人不知道 怎么加延迟

我知道
作者: xiaoknb    时间: 2021-12-16 11:52
大水货,能不能分享点有用的
你还不如直接把官方文档复制过来呢
作者: superlu    时间: 2021-12-20 16:19
水贴回复




欢迎光临 精易论坛 (https://125.confly.eu.org/) Powered by Discuz! X3.4