a simple and free messages notice with and for React.
Live demo: asd0102433.github.io/react-notice-message/example
The live demo is still running v1.0.8
.
To build the new 1.0.0 examples locally, clone this repo then run:
npm install
npm start
Then open localhost:8080
in a browser.
或者直接 open example/index.html
npm install react-notice-message --save
At this point you can import react-notice-message and its styles in your application as follows:
import react-notice-message from 'react-notice-message';
// you can modify css in the react-notice.css or Write one other css style , because the css is simple and crude.
import 'react-select/react-notice.css';
var reactNotice = require('react-notice-message');
//reactNotice.show(document, {closeTime:"3000"});
reactNotice.show(<p>messages</p>, options); //Value: 3000 or infinite
reactNotice.getHistoryMessages();
###options
closeTime
: Any time, 3000 5000 or infinite;
// Show notice messages
reactNotice.show();
//Get history messages
reactNotice.getHistoryMessages();
MIT Licensed. Copyright (c) aotumen 2016.