hc-tips

1.0.1 • Public • Published

hc-tips

npm npm license

基于hyperapp.js和WeUI的Tips组件

安装

npm i -S hc-tips

使用

直接使用

  <script src="https://unpkg.com/hyperapp@1.2.5/dist/hyperapp.js"></script>
  <script src="node_modules/hc-tips/dist/index.js"></script>
  <script>
    window.HCTips.toast('消息提示')
  </script>

ES6

  import HCTips from 'hc-tips'

  HCTips.toast('消息提示')

方法

  • tosat (options: object | content: string)

  • loading (options: object | content: string)

  • alert (options: object | content: string)

  • confirm (options: object | content: string)

options (toast | loading)

content

type: string

required: true

duration

type: number

default: 2000

type

type: string

optional: 'info', 'error'

default: 'info'

options (alert | confirm)

content

type: string

required: true

title

type: string

confirmText

type: string

default: '确定'

cancelText

type: string

default: '取消'

showCancel

type: boolean

default: true

是否显示取消按钮,alert方法为false

onCancel

type: function

点击取消按钮回调

onConfirm

type: function

点击确定按钮回调

Package Sidebar

Install

npm i hc-tips

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

35.8 kB

Total Files

15

Last publish

Collaborators

  • youngluo