single-dialog
v0.0.31
Published
``` npm install single-dialog ```
Downloads
7
Readme
single-dialog
游戏
安装
npm install single-dialog
使用
- json
{
"usingComponents": {
"single-dialog": "single-dialog/single-dialog"
}
}
- mini.project.json
{
"node_modules_es6_whitelist": [
"single-dialog"
]
}
- js
Page({
data: {
// 弹窗组件------------------begin
dialog: {
bgColor: "rgba(0,0,0,0.8)",
style: "height: 942rpx;top:336rpx;",//此处可以不传height,插件会自动使用背景总高。如果此处设置了值,则使用该值
animationType: "rightToLeft",//动画方式 rightToLeft:从右划入 leftToRight:从左划入 upToDown:从上划入 downToUp: 从下划入 为空则默认渐显
duration: 1000,//动画时间 ms
bg: [
{ "imageUrl": "https://img.alicdn.com/imgextra/i2/1080040467/O1CN01W4jbyZ1FJvem0ObsB_!!1080040467.png", "width": "750", "height": "470" },
{ "imageUrl": "https://img.alicdn.com/imgextra/i1/1080040467/O1CN01x4wEpR1FJvetuzDUA_!!1080040467.png", "width": "750", "height": "472" },
],
closeBtn: {
width: 50,
height: 216,
left: 0,
top: 474,
},
// 容器默认占满,padding
padding: {
left: 46,
top: 0,
right: 46,
bottom: 0
},
},
// 弹窗组件------------------end
},
onDialogRef(DialogRef) {
this.DialogRef = DialogRef;
},
onDialogInitDone() {
this.openDialog();
},
openDialog() {
this.DialogRef.openDialog();
},
})
- xaml
<single-dialog gameSource="{{dialog}}" a:if="{{dialog}}" onRef="onDialogRef" onInitDone="onDialogInitDone">
</single-dialog>