JavaScript 的一个干净简洁的通知、输入和选择套件,无任何依赖
notie 是一个简洁干净的 JavaScript 通知、输入和选择套件,无任何依赖
在线演示:https://jaredreich.com/notie
<head>
...
<link rel="stylesheet" type="text/css" href="https://unpkg.com/notie/dist/notie.min.css">
<style>
/* override styles here */
.notie-container {
box-shadow: none;
}
</style>
</head>
<body>
...
<script src="https://unpkg.com/notie"></script>
</body>npm install notieimport notie from 'notie'
// or
import { alert, force, confirm, input, select, date, setOptions, hideAlerts } from 'notie'notie
// or
window.notie……this:notie.confirm({
text: 'Leave the page?',
submitCallback: () => this.location.href = 'https://google.com'
})
notie.confirm({
text: 'Is ES6 great?',
cancelCallback: () => notie.alert({ type: 3, text: 'Why not?' }),
submitCallback: () => notie.alert({ type: 1, text: 'I Agree' })
})
notie.force({
type: 3,
text: 'You cannot do that, sending you back.',
buttonText: 'OK',
callback: () => notie.alert({ type: 3, text: 'Maybe when you\'re older...' })
})// 在导入 notie 之前:
$notie-color-success: #57BF57;
$notie-color-warning: #D6A14D;
$notie-color-error: #E1715B;
$notie-color-info: #4D82D6;
$notie-color-neutral: #A0A0A0;
// 所有可覆盖的变量请参见 src/notie.scss
// 然后导入 notie:
@import '../../node_modules/notie/src/notie';暂无开放 Issues,或尚未同步最近议题。