A nifty flash message component for use in wepyjs, a Vue-like framework for building WeChat mini programs.
npm install wepy-com-paper-flash --save
For example, on a page index.wpy
// index.wpy
<template>
// your page WXML here
<flash/>
</template>
<script>
import wepy from 'wepy'
import Flash from 'wepy-com-paper-flash'
export default class Index extends wepy.page {
components = {
flash: Flash
}
}
</script>
Inside of a @tap
handler (or anywhere in a wepy component or page), you could invoke the flash to display a message
// index.wpy
const message = 'Product added to cart'
this.$invoke('flash', 'showMessage', message)