npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ew-message

v0.1.8

Published

一个基于typescript封装的消息提示框

Downloads

66

Readme

English | 简体中文

ew-message

NPM version npm npm GitHub stars GitHub stars

A message plugin encapsulated based on typescript.

Installation and Usage

Installation

npm install ew-message --save-dev//或者 yarn add ew-message

import

<script src="./dist/ew-message.min.js"></script>

The message plugin code is as follows:

const msg1 = ewMessage('the default message');
const msg1 = ewMessage({
  content: 'the default message'
});

The option configuration object has the following parameters:

interface ewMessageOption {
  content: string; // content required
  center?: boolean; // center the content
  type?: string; // message type: info,success,warning,error
  duration?: number; // duration to close the message
  showClose?: boolean; // Whether to display the close button
  showTypeIcon?: boolean; // Whether to display the type icon, the default value is true
  typeIcon?: string; // custom the type icon
  closeIcon?: string; // custom the close icon
  container?: string | HTMLElement; // mounted element
  removeClassName?: string[]; // Remove the message animation class name. Currently, the built-in animation class name values ​​are: fadeOut and scaleDown
  startClassName?: string[]; // Add the message animation class name, currently built-in animation class name values: fadeIn and scaleUp
  top?: number; // Used to customize the top offset value of each message
}

import by cdn

// import the css
// CDN:https://www.unpkg.com/ew-message/dist/ew-message.min.css
// CDN:https://www.unpkg.com/ew-message/dist/ew-message.min.js

use in component

import ewMessage from 'ewMessage';
// import css
import 'ew-message/dist/ew-message.min.css';
const msg = ewMessage(option); // option is a configuration object, see above for details

For more details, please refer to the official website introduction ew-message;

update log

  • 0.0.1 ~ 0.0.4: Added basic functions of message。
  • 0.0.5: update the ts about import。
  • 0.0.6: add destroy method。
  • 0.0.7: Improved the typescript, added the maximum closing time attribute maxDuration, and modified the default closing time。
  • 0.0.8: Added showTypeIcon and typeIcon attributes and closeIcon for configuring icons, and added the tool method createElement.
  • 0.0.9: Added container, immediate, removeClassName, removeClassNameSymbol configuration attributes, and added on, off, addClass tool methods.
  • 0.1.0: Fixed ts type errors, added messageZIndex attribute.
  • 0.1.1: Added top attribute, added startClassName and startClassNameSymbol attributes, and added removeClass method.
  • 0.1.2: Modified the logic of destroying the message, added isArray and isRemoveNode methods.
  • 0.1.3: Adjusted the code structure, added position attribute, and added isUndef method.
  • 0.1.4: Removed stylePrefix and the logic of monitoring whether the style is loaded.
  • 0.1.5: Removed a lot of unnecessary code APIs and logic.
  • 0.1.6: Fixed ts type issues, optimized some codes, improved unit tests, and added a loading message.
  • 0.1.7: Fixed ts type issues, fixed the problem of being unable to close the message.
  • 0.1.8: Fixed a problem with redirect location。