Big News: Socket Selected for OpenAI's Cybersecurity Grant Program.Details
Socket
Book a DemoSign in
Socket

wx-tips

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wx-tips

wx-tips

latest
Source
npmnpm
Version
1.0.5
Version published
Maintainers
1
Created
Source

Tips 微信原生tips封装

安装

npm install wx-tips  # npm安装方式
yarn add wx-tips  # yarn安装方式

使用指南

// utils/tips.js
import tips from 'wx-tips'

export default const instance = tips.getInstance({
    errorIconPath: '/images/error.png', // 错误提示图片路径  必须提供
    alertIconPath: '/images/alert.png', // alert提示图片路径 必须提供
    loadingMode: 'Loading' // 选项 NavigationBarLoading|Loading
})
// app.js
import tips '/utils/tips'

tips.alert('alert')
tips.modal('modal')
tips.loading()
tips.loaded()

tips getInstance方法参数配置

参数说明类型默认值必须
errorIconPath错误提示图片路径 绝对路径String''true
alertIconPathalert提示图片路径 绝对路径String''true
loadingModeloading模式 Loading对应 wx.showLoading/wx.hideLoading NavigationBarLoading对应 wx.showNavigationBarLoading/wx.hideNavigationBarLoadingStringNavigationBarLoadingfalse
duration显示周期,毫秒int1000false

tips 实例方法api

    static getInstance(config = {}) this
    success(title, duration = '') Promise
    modal(content = '', title = '') Promise
    confirm(content, payload = {}, title) Promise
    toast(title, hideCallback, icon = 'success', duration = '')
    loading(title = '', force = false)
    loaded()
    alert(title, duration = '') Promise
    error(title, hideCallback, duration = '')
    setLoading()

Keywords

wx

FAQs

Package last updated on 20 Apr 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