Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johncalvinroberts/wepy-com-paper-flash
https://github.com/johncalvinroberts/wepy-com-paper-flash
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/johncalvinroberts/wepy-com-paper-flash
- Owner: johncalvinroberts
- License: mit
- Created: 2018-05-20T16:53:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-20T20:18:56.000Z (over 6 years ago)
- Last Synced: 2024-11-10T06:44:12.720Z (2 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-wepy - wepy-com-paper-flash: 基于wepy的简洁帅气flash组件
README
# wepy-com-paper-flash
A nifty flash message component for use in [wepyjs](https://github.com/wepyjs/wepy), a Vue-like framework for building WeChat mini programs.
## What it looks like
![flash](https://user-images.githubusercontent.com/11850362/40283129-1dcd25fc-5cac-11e8-9361-e0d295f6ca1d.gif)## Usage
### installation
```
npm install wepy-com-paper-flash --save
```### Importing the component
For example, on a page `index.wpy`
```javascript
// index.wpy// your page WXML here
import wepy from 'wepy'
import Flash from 'wepy-com-paper-flash'export default class Index extends wepy.page {
components = {
flash: Flash
}
}```
### Displaying a message
Inside of a `@tap` handler (or anywhere in a wepy component or page), you could invoke the flash to display a message
```javascript
// index.wpy
const message = 'Product added to cart'
this.$invoke('flash', 'showMessage', message)
```