GithubHelp home page GithubHelp logo

lightningminers / react-easy-toast Goto Github PK

View Code? Open in Web Editor NEW
2.0 0.0 0.0 1.6 MB

可快速简单使用的 React Toast 组件

License: MIT License

HTML 5.77% JavaScript 30.77% TypeScript 59.41% CSS 4.06%
react toast typescript

react-easy-toast's Introduction

React Easy Toast

img img img

可快速简单使用的 React Toast 组件

img

$ yarn add react-easy-toast --save
import React from "react";
import ReactDOM from "react-dom";
import * as toast from "../lib";

console.log(toast);

class App extends React.Component{
  onToast(key){
    toast[key](key);
  }
  render(){
    return (
      <div className="container">
        <button onClick={this.onToast.bind(this, "show")}>default</button>
        <button onClick={this.onToast.bind(this, "message")}>message</button>
        <button onClick={this.onToast.bind(this, "ok")}>ok</button>
        <button onClick={this.onToast.bind(this, "error")}>error</button>
        <button onClick={this.onToast.bind(this, "warning")}>warning</button>
      </div>
    );
  }
}

ReactDOM.render(
  <App/>,
  document.querySelector('#app')
);

LICENSE

MIT License Copyright (c) 2019 子曰五溪

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.