Giter VIP home page Giter VIP logo

coco-message's Introduction

coco-message

coco-message 是一个简单实用的javascript信息提示插件, 兼容主流浏览器,兼容至ie9 (ie没有svg动画)

Usage

install via cnpm:

cnpm install coco-message -S
import cocoMessage from 'coco-message'
  
cocoMessage('hello world')
or
cocoMessage.info('hello world')
<script src="https://unpkg.com/coco-message/coco-message.min.js"></script>

暗黑模式

<html class="dark">

在html标签上添加dark样式名即可

Examples

在线示例

基本用法

对参数没有顺序要求,cocoMessage会根据参数的数据类型进行解析

  cocoMessage.config({       //全局配置
    duration: 10000,         //消息显示时长
  });
      
  const close = cocoMessage.info(
   "请先登录!",            //消息文本
   3000,                    //消息显示时长
    ()=> {                  //回调函数
     console.log("close");
    }
  );
  
  close();                  //关闭消息方法
  
            
  var div = document.createElement("div");
  div.innerText = "修改成功!";
  cocoMessage.success(
    ()=>{
      console.log("close");
    },
    div
  );
  

coco-message's People

Contributors

thewindrises-2 avatar

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.