Skip to content

m-toast 提示框

简述

提示框,用于短暂显示提示信息。

注意

请以 uni_modules/m-unix 与本文为准;各端差异以 uni-app 与各平台官方文档为准。涉及隐私能力(相册、定位、剪贴板、手机号等)需在 manifest 与后台完成配置。

平台差异说明

App(vue)App(nvue)H5小程序

演示地址

与线上 H5 演示基座 分包一致(文档站右下角预览 iframe 亦指向同一路径)。

类型地址
分包路径pages_demo/toast/toast
线上 H5(hash)打开演示

基本使用

uvue
<template>
	<view>
		<m-toast
			:show="show"
			text="操作成功"
		></m-toast>
	</view>
</template>

Props

参数说明类型默认值
show是否显示booleanfalse
text提示文字string''
icon图标 URLstring''
position位置 center / top / bottomstringcenter
mask是否显示遮罩booleanfalse

示例

文字提示

uvue
<m-toast :show="show" text="这是提示"></m-toast>

带图标

uvue
<m-toast
	:show="show"
	text="成功"
	icon="https://example.com/success.png"
></m-toast>

底部显示

uvue
<m-toast
	:show="show"
	text="提示"
	position="bottom"
></m-toast>

带遮罩

uvue
<m-toast
	:show="show"
	text="加载中..."
	mask
></m-toast>

Released under the MIT License.