this script is a simple popup and fit for mobile
Using npm:
$ npm install --save yu-popup
$ import popup from 'yu-popup'
You can use npm run dev
to check the example file in node package
popup({
type:'success',
iconType:0,
title:'hey!',
desc:['you got this message',"beautiful,isn't it?"],
width:80,
timing:1500,
mounted(){
console.log('popup will be create')
},
callback(){
console.log('popup has been destroyed')
}
})
* @param {object[]} option
* @param {string} [option[].type = ''] - type of popup,accept 'success' 'error' 'info' 'loading' & ''(no image)
* @param {number|string} [option[].iconType = 0] - type of icon,through 1 to 5
* @param {string} [option[].title] - title of popup
* @param {(string|string[])} [option[].desc] - description of popup ,if it be array,the description will show in multi line
* @param {number} [option[].width = 80] - width of popup,the min width is 80,don't less than it
* @param {number} [option[].timing = 1500] - auto close time,if popup's type is 'loading' or '',timing will be useless
* @param {callback} [option[].mounted] - run before popup join in dom
* @param {callback} [option[].callback] -run after popup destroyed