Coder Social home page Coder Social logo

yaohaixiao / message.js Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 895 KB

message.js - 一个小巧实用的 JavaScript 提示信息工具库!

Home Page: https://yaohaixiao.github.io/message.js

License: MIT License

JavaScript 65.51% Shell 0.07% Less 10.02% Pug 24.40%
javascript message

message.js's Introduction

message.js

npm version Gzip size prettier code style Coverage npm downloads MIT License

message.js - 一个小巧实用的 JavaScript 提示信息工具库!

特点

  • 原生 JavaScript 编写;
  • 支持 UMD 规范;
  • 提供功能独立的 ES6 模块代码;
  • 配置丰富且灵活,调用简单;
  • 体积小;

浏览器支持

Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
Edge last 10 versions last 10 versions last 10 versions last 10 versions

安装说明

message.js 提供多种安装方式的支持: npm 安装、加载 CDN 资源、以及本地资源调用。

npm install

npm i @yaohaixiao/message.js

CDN 调用

<link href="https://cdn.jsdelivr.net/gh/yaohaixiao/message.js/message.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/gh/yaohaixiao/message.js/message.min.js"></script>

调用本地JS文件

<link href="path/to/message.min.css" rel="stylesheet" /></script>
<script src="path/to/message.min.js"></script>

Usage

message.js 调用起来十分便捷,配置信息也十分丰富。

// 导入 Message 模块
import Message from '@yaohaixiao/message.js/message'

// 使用静态方法
Message.info({
  duration: 5,
  message: 'message.js - 一个小巧实用的 JavaScript 提示信息工具库。'
})


Message.success({
  round: true,
  message: 'message.js - 一个小巧实用的 JavaScript 提示信息工具库。'
})


Message.warning({
  effect: 'light',
  message: 'message.js - 一个小巧实用的 JavaScript 提示信息工具库。'
})


Message.error({
  effect: 'plain',
  message: 'message.js - 一个小巧实用的 JavaScript 提示信息工具库。'
})


// 使用 Message 对象创建实例
// 详细 options 配置,请查看 API 文档中的说明
new Message({
  id: 'info-001',
  type: 'info',
  effect: 'default',
  round: false,
  offset: 30,
  duration: 6,
  delay: 2,
  message: '<a href="https://github.com/yaohaixiao/message.js">message.js</a> - 一个小巧实用的 JavaScript 提示信息工具库。',
  customClass: '',
  closable: true,
  visible: true,
  dangerouslyUseHTMLString: false,
  destroyAfterClosed: true,
  beforeClose: null
})

API Documentation

API 文档地址:https://yaohaixiao.github.io/message.js

License

Licensed under MIT License.

message.js's People

Contributors

yaohaixiao avatar

Stargazers

数字生活指南 avatar

Watchers

 avatar

message.js's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.