Skip to content
官方QQ交流群
pc端ui:468705115   点此加入
移动端ui:468217742   点此加入
技术交流1:87208295   点此加入
技术交流2:787747122   点此加入
官网
云控制台
开放平台
关注微信公众号
代码仓库: 码云

Notify 消息提示

该组件一般用于页面顶部向下滑出一个提示,尔后自动收起的场景。

平台差异说明

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

基本使用

html
<template>
	<up-notify message="Hi uView" :show="show"></up-notify>
</template>

<script>
export default {
    data() {
        return {
            show: true
        }
    }
}
</script>

ref调用

html
<template>
	<up-notify ref="uNotify" message="Hi uView"></up-notify>
</template>

<script>
export default {
    onReady(){
	    this.$refs.uNotify.show({
            top: 10,
            type: 'error',
            color: '#000',
            bgColor: '#e8e8e8',
            message: 'Hi uView',
            duration: 1000 * 3,
            fontSize: 20,
            safeAreaInsetTop:true
        })

        // 也可以通过主题形式调用,如:
        // this.$refs.uNotify.primary('Primary主题')
        
        // 关闭 notify
        // this.$refs.uNotify.close()
    }
}
</script>

此页面源代码地址

页面源码地址


 github  gitee

API

Methods

事件名说明类型
show显示并加载配置Handler
primary / success / warning /error显示当前主题消息提示Handler
close关闭消息提示Handler

Show Methods Arguments

参数说明类型默认值可选值
top到顶部的距离String/Number0-
type主题,primary,success,warning,errorStringprimary-
color字体颜色String#ffffff-
bgColor背景颜色String--
message展示的文字内容String--
duration展示时长,为0时不消失,单位msString/Number3000-
fontSize字体大小,单位rpxString/Number15-
safeAreaInsetTop是否留出顶部安全距离(状态栏高度)Booleanfalsetrue

Slot

参数说明
icon通知内容

Copyright © 2017 10yun.com | 十云提供计算服务-IPV6 | ctocode组开发