基于蚂蚁2.0UI控件
import { ActionSheet ,Button} from 'antd-mobile';
分享方式1:
const BUTTONS = ['操作一', '操作二', '操作三', '删除', '取消'];
ActionSheet.showActionSheetWithOptions({
title: '标题',
message: '我是描述我是描述',
options: BUTTONS,
cancelButtonIndex: 4,
destructiveButtonIndex: 3,
}, (buttonIndex) => {
alert(BUTTONS[buttonIndex])
});
分享方式2:
const opts = {
url: 'https://www.alipay.com/',
message: '分享',
subject: '123123',
};
ActionSheet.showShareActionSheetWithOptions(opts, (error) => alert(error), (success, method) => {
let text;
if (success) {
text = `通过 ${method} 分享`;
}
else {
text = '您没有分享';
}
alert(text) ;
});
网友评论