feat:add confirm of modal for Android and iOS

This commit is contained in:
pengfei.zhou
2019-11-20 20:36:01 +08:00
parent 3f5099d29a
commit 2290c8cd48
5 changed files with 114 additions and 5 deletions

View File

@@ -77,6 +77,37 @@ class ModalDemo extends Panel {
})
}
} as IText),
text({
text: "Confirm",
layoutConfig: layoutConfig().w(LayoutSpec.AT_MOST),
textSize: 30,
textColor: Color.WHITE,
bgColor: colors[3],
textAlignment: Gravity.Center,
height: 50,
}),
label('Click me').apply({
width: 200,
height: 50,
bgColor: colors[0],
textSize: 30,
textColor: Color.WHITE,
layoutConfig: layoutConfig().exactly(),
onClick: () => {
modal(context).confirm({
msg: 'This is Confirm.',
title: 'Confirm title',
okLabel: "OkLabel",
cancelLabel: 'CancelLabel',
}).then(
e => {
modal(context).toast('Clicked OK.')
},
e => {
modal(context).toast('Clicked Cancel.')
})
}
} as IText),
]).apply({
layoutConfig: layoutConfig().atmost().h(LayoutSpec.WRAP_CONTENT),
gravity: Gravity.Center,