Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/johncalvinroberts/wepy-com-paper-modal


https://github.com/johncalvinroberts/wepy-com-paper-modal

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# wepy-com-paper-modal

A handsome modal component for use in [wepyjs](https://github.com/wepyjs/wepy), a Vue-like framework for building WeChat mini programs.

## What it looks like
![modal](https://user-images.githubusercontent.com/11850362/40283133-1e82f29c-5cac-11e8-89b2-1010003807e1.gif)

## Usage
### installation
```
npm install wepy-com-paper-modal --save
```

### Importing the component

For example, on a page `index.wpy`
```javascript
// index.wpy


// Slot, put your WXML content of modal here

import wepy from 'wepy'
import Modal from 'wepy-com-paper-modal'

export default class Index extends wepy.page {
components = {
modal: Modal
}
}

```

### Showing the modal
Inside of a `@tap` handler (or anywhere in a wepy component or page), you could invoke the modal to display, i.e. show the modal by calling the /toggle/ function
```javascript
// index.wpy
this.$invoke('modal', 'toggle', null)
```

### Props
There are two props exposed on `wepy-com-paper-modal`

#### open
Default set to `true`
```javascript

// slot

```

#### closeCLass
Set a custom class to the ‘x’ close icon
```javascript

// slot

```