ph-modal
v0.1.0-beta.0
Published
## Project setup ``` npm install ph-modal ```
Downloads
1
Readme
vue-template
Project setup
npm install ph-modal
接口介绍
enum PhConfirmAction{
Done=1,
Cancel=0,
}
type PhConfirmOpt = {
doneText?:string,
cancelText?:string,
title?:string
}
type PhAlertOpt = {
doneText?:string,
title?:string
}
interface PhModelShowRetrun{
done(fn:(a:PhConfirmAction)=>void):void
}
interface PhModal{
alert(context:string,opt?:PhAlertOpt):void
confirm(content:string,opt?:PhConfirmOpt):PhModelShowRetrun,
}
#基本用法
//全局引入
import PhModal from 'ph-modal'
app.use(PhModal)
//子组件通过如下
this.$phAlert(context:string,opt?:PhAlertOpt):void
this.$phConfirm(content:string,opt?:PhConfirmOpt):PhModelShowRetrun
//局部引入
import PhModal from 'ph-modal'
PhMldal
//静态方法
alert(context:string,opt?:PhAlertOpt):void
//静态方法
confirm(content:string,opt?:PhConfirmOpt):PhModelShowRetrun
#案例 See 在线案例.