// Utils import { createNamespace, pick } from '../utils'; // Components import Popup, { popupSharedProps } from '../popup'; const PRESET_ICONS = [ 'qq', 'link', 'weibo', 'wechat', 'poster', 'qrcode', 'weapp-qrcode', 'wechat-moments', ]; function getIconURL(icon) { if (PRESET_ICONS.indexOf(icon) !== -1) { return `https://img.yzcdn.cn/vant/share-sheet-${icon}.png`; } return icon; } const [createComponent, bem, t] = createNamespace('share-sheet'); export default createComponent({ props: { ...popupSharedProps, title: String, cancelText: String, description: String, options: { type: Array, default: () => [], }, closeOnPopstate: { type: Boolean, default: true, }, safeAreaInsetBottom: { type: Boolean, default: true, }, }, emits: ['cancel', 'select', 'update:show'], setup(props, { emit, slots }) { const toggle = (value) => { emit('update:show', value); }; const onCancel = () => { toggle(false); emit('cancel'); }; const onSelect = (option, index) => { emit('select', option, index); }; const renderHeader = () => { const title = slots.title ? slots.title() : props.title; const description = slots.description ? slots.description() : props.description; if (title || description) { return (