New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vavt/message

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vavt/message

A native JS crafted message notification component, encompassing features for displaying messages, warnings, successes, and errors.

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@vavt/message

原生 js 编写的消息提示组件。包括消息、警告、成功和错误提示。

安装

yarn add @vavt/message

使用

import { message } from '@vavt/message';

// error, success, info, warning
const { close, update } = message.info('这是一条普通信息');

// 更新内容
update('这是更新后的内容');

// 手动关闭
close();

// 关闭全部
message.closeAll();

属性

类型名称默认值描述
class''
singlefalse是否只显示一个提示
offsetTop20单个提示距离上一个提示的距离
duration3000该时间后自动关闭,<=0 时不会自动关闭
closeablefalse是否显示关闭按钮
darkSelector:root[data-theme=dark]暗夜模式的选择器,只能通过config配置,不能调用时设置
zIndex9999

配置方式

配置全局属性

message.config({ duration: 5000 });

在调用时配置

message.warning('这条消息不会自动关闭', { duration: 0 });

Keywords

FAQs

Package last updated on 24 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc