用 webpack 和 postcss 打包的,直接引用 JS 即可,自动插♂入 CSS 。
眼见为实,在线演示: http://egoist.github.io/notie
NPM and Webpack ready:
import notie from 'notie'
// tell notie to show `hello world` info and auto-hide it.
notie('info', 'hello world', true)
// or use object as argument
notie({
type: 'info',
text: 'hello world',
autoHide: true
})
当然开源的: GitHub