先上图~
这是我自己写的一个用于分享的开源组件
github地址:https://github.com/yangkaixuan/ionic-actionsheet2
安装
npm i ionic-actionsheet2 --save
Import In AppModule
import { ActionSheet2Module } from 'ionic-actionsheet2';
@NgModule({
declarations: [
],
imports: [
ActionSheet2Module
]
})
Use In Templete
import { Actionsheet2controllerProvider } from 'ionic-actionsheet2';
constructor(private act2controller :Actionsheet2controllerProvider) {
}
接口于官方发布的接口类似
this.act2controller.create({
buttons: [
{
text: '微信',
imgurl:"assets/imgs/weixinpic.png",
handler: () => {
},
},
{
text: '微信朋友圈',
imgurl:"assets/imgs/weixinzone.png",
handler: () => {
},
},{
text: 'qq',
imgurl:"assets/imgs/qq.png",
handler: () => {
}
}
,{
text: 'qq空间',
imgurl:"assets/imgs/qqzone.png",
handler: () => {
}
}
]
})