https://github.com/youngluo/hyperapp-tips-components
A tips components based on Hyperapp and WeUI.
https://github.com/youngluo/hyperapp-tips-components
hyperapp tips weui
Last synced: 6 months ago
JSON representation
A tips components based on Hyperapp and WeUI.
- Host: GitHub
- URL: https://github.com/youngluo/hyperapp-tips-components
- Owner: youngluo
- License: mit
- Created: 2018-04-25T14:57:29.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-05T12:03:28.000Z (over 7 years ago)
- Last Synced: 2025-07-14T12:51:40.586Z (7 months ago)
- Topics: hyperapp, tips, weui
- Language: JavaScript
- Homepage: https://youngluo.github.io/hyperapp-tips-components
- Size: 63.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# hc-tips
[](https://www.npmjs.com/package/hc-tips)
[](https://www.npmjs.com/package/hc-tips)
[](https://github.com/youngluo/hyperapp-tips-components/blob/master/LICENSE)
> 基于hyperapp.js和WeUI的Tips组件
## 安装
npm i -S hc-tips
## 使用
### 直接使用
window.HCTips.toast('消息提示')
### 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`
点击确定按钮回调