notice-toast

172 阅读1分钟

notice-toast

文档与演示

image.png

image.png

use

import { JNoticeToast, noticeToastPlugin } from 'jeft-vue/components/notice-toast'

props

参数类型默认值描述
showBooleanfalse显示
delayNumber3000时间间隔
items[]Item[]消息列表
colorColorrgba(253, 180,0, 0.6)背景颜色
textColorColor#fff文字颜色
positionabsolute/fixedabsolute定位方式
topNumber/String70据顶部距离
basePositionleft/rightleft左侧/右侧
typehalf/allall半圆形/全圆形
zIndexNumber100层级

item

参数类型默认值描述
userAvatarString''可不传
messageString''文字信息

plugin

Vue.use(noticeToastPlugin)
showToast() {
      this.noticeToastShow = !this.noticeToastShow
      this.$noticeToast({
        show: this.noticeToastShow,
        items: this.noticeToastItems
      })
    }

demo

  <j-notice-toast :show="show" :items="items"></j-notice-toast>
  <j-notice-toast
    :show="show"
    type="half"
    top="200"
    :items="items"
  ></j-notice-toast>
data() {
    return {
      show: true,
      items: [
        {
          message: "1发布了...",
        },
        {
          message: "2发布了",
        },
        {
          message: "3获得了...",
        },
      ],
    };
  },
  mounted() {
    this.$noticeToast({
      show: true,
      items: this.items,
      basePosition: "right",
      top: 60,
    });
  },
  beforeDestroy() {
    this.$noticeToast({
      show: false,
    });
    this.show = false;
  },