提交 c343facc 编写于 作者: Q qiang

feat: app-v3 uni.showActionSheet 支持 popover 配置

上级 a849158f
...@@ -110,5 +110,8 @@ export const showActionSheet = { ...@@ -110,5 +110,8 @@ export const showActionSheet = {
visible: { visible: {
type: Boolean, type: Boolean,
default: true default: true
},
popover: {
type: Object
} }
} }
...@@ -154,11 +154,12 @@ export function showModal ({ ...@@ -154,11 +154,12 @@ export function showModal ({
export function showActionSheet ({ export function showActionSheet ({
itemList = [], itemList = [],
itemColor = '#000000', itemColor = '#000000',
title = '' title = '',
popover
}, callbackId) { }, callbackId) {
const options = { const options = {
buttons: itemList.map(item => ({ buttons: itemList.map(item => ({
title: item, title: item,
color: itemColor color: itemColor
})) }))
} }
...@@ -170,7 +171,7 @@ export function showActionSheet ({ ...@@ -170,7 +171,7 @@ export function showActionSheet ({
options.cancel = '取消' options.cancel = '取消'
} }
plus.nativeUI.actionSheet(options, (e) => { plus.nativeUI.actionSheet(Object.assign(options, { popover }), (e) => {
if (e.index > 0) { if (e.index > 0) {
invoke(callbackId, { invoke(callbackId, {
errMsg: 'showActionSheet:ok', errMsg: 'showActionSheet:ok',
...@@ -182,4 +183,4 @@ export function showActionSheet ({ ...@@ -182,4 +183,4 @@ export function showActionSheet ({
}) })
} }
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册