Tip.js 演示 - 轻量级交互组件库

📦 安装使用

<script src="tip.js"></script> <script> // 直接使用,无需任何HTML设置 tip.success('操作成功!'); tip.error('出现错误!'); tip.info('这是一条信息'); tip.warning('请注意!'); </script>

🍞 Toast 提示

显示不同类型的提示消息,支持自定义显示时间

📚 API 文档

// Toast 提示 tip.toast(message, type, options) tip.success(message, options) tip.error(message, options) tip.info(message, options) tip.warning(message, options) // 确认对话框 tip.confirm(message, callback, options) // 输入对话框 tip.prompt(message, callback, options) // 加载遮罩 tip.loading.show(message) tip.loading.hide() tip.showLoading(message) tip.closeLoading() // 清理方法 tip.clearToasts() tip.closeAllModals() tip.closeAllLoading() tip.clearAll()