Files
MiniProgram/ProjectLiaisonForm/pages/action-sheet/grid/index.js

66 lines
1.3 KiB
JavaScript
Raw Normal View History

2025-08-15 14:05:08 +08:00
import ActionSheet, { ActionSheetTheme } from 'tdesign-miniprogram/action-sheet/index';
const firstGrid = [
{
label: '微信',
image: 'https://tdesign.gtimg.com/mobile/demos/wechat.png',
},
{
label: '朋友圈',
image: 'https://tdesign.gtimg.com/mobile/demos/times.png',
},
{
label: 'QQ',
image: 'https://tdesign.gtimg.com/mobile/demos/qq.png',
},
{
label: '企业微信',
image: 'https://tdesign.gtimg.com/mobile/demos/wecom.png',
},
{
label: '收藏',
icon: 'star',
},
{
label: '刷新',
icon: 'refresh',
},
{
label: '下载',
icon: 'download',
},
{
label: '复制',
icon: 'queue',
},
];
Component({
methods: {
handleAction() {
ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: firstGrid,
});
},
handleMultiAction() {
ActionSheet.show({
theme: ActionSheetTheme.Grid,
selector: '#t-action-sheet',
context: this,
items: firstGrid.concat(
new Array(8).fill({
label: '标题文字',
icon: 'image',
}),
),
});
},
handleSelected(e) {
console.log(e.detail);
},
},
});