popup-layer
v1.0.2
Published
popup tip
Downloads
1
Readme
popup-layer
About
Popup-layer is a pop-up plugin,it exposes a base class outwards, which means that you can completely customize attributes and methods by instantiating them.Popup-layer is written through native JS, independent of the third party library.
Install
npm install popup-layer
Import
import popup from 'popup-layer';
Instantiation
Popup-layer provides a static method to customize configuration.
// here is a simple example
popup.open({
title: 'Title',
content: 'Hello Popup-Layer!',
});
Properties
- title {string}: message header
- content {string}: message content
- time {number}: popup-layer auto shut down time(millisecond)
- popupHeader {object}: custom message header styles
- popupContent {object}: custom message content styles
- popupFooter {object}: custom message footer styles
In addition, you can directly copy
popup-layer
styles, such as fontSize:'16px'
Methods
- btnCancel: callback method for cancel button
- btnClose: callback method for close button
- btnOk: callback method for ok button