New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

api-toast

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

api-toast

在做h5移动端混合开发时,为了更好地用户体验,弹窗提示是必须的。toast类型的弹窗更是几乎每个APP都用得到的(这里toast类型弹窗是指从屏幕底部弹起一个半透明的会渐变消失的小块)。由于本人在开发时需要用到这个弹窗,但是npm上又找不到合适的类似插件,一些UI框架倒是有,但是又不想为了这么小的一个功能引入偌大的一整个UI框架,故自造之。 ### 用法: #### 安装

  • 1.0.5
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

功能描述:

在做h5移动端混合开发时,为了更好地用户体验,弹窗提示是必须的。toast类型的弹窗更是几乎每个APP都用得到的(这里toast类型弹窗是指从屏幕底部弹起一个半透明的会渐变消失的小块)。由于本人在开发时需要用到这个弹窗,但是npm上又找不到合适的类似插件,一些UI框架倒是有,但是又不想为了这么小的一个功能引入偌大的一整个UI框架,故自造之。

用法:

安装
npm i --save-dev api-toast

如果已安装淘宝镜像,可以使用cnpm

引入

在项目主文件(如main.js)中引入

import api from "api-toast";
window.api=api;
使用

在项目中可以使用语法:

api.toast("message",3000);

弹出toast类型的提示信息。 此方法接收两个参数,第一个参数是字符串类型的message;第二个参数是弹出提示3000ms后消失,可自定义。

==PS:webpack必须配置有css-loader跟style-loader。==

Keywords

FAQs

Package last updated on 19 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc