// Utils import { createNamespace, isDef } from '../utils'; // Mixins import { popupMixinProps } from '../mixins/popup'; // Components import Popup from '../popup'; const PRESET_ICONS = ['qq', 'weibo', 'wechat', 'link', 'qrcode', 'poster']; const [createComponent, bem, t] = createNamespace('share-sheet'); export default createComponent({ props: { ...popupMixinProps, title: String, cancelText: String, description: String, options: { type: Array, default: () => [], }, safeAreaInsetBottom: { type: Boolean, default: true, }, }, methods: { onCancel() { this.toggle(false); this.$emit('cancel'); }, onSelect(option, index) { this.$emit('select', option, index); }, toggle(val) { this.$emit('input', val); }, getIconURL(icon) { if (PRESET_ICONS.indexOf(icon) !== -1) { return `https://img.yzcdn.cn/vant/share-icon-${icon}.png`; } return icon; }, genHeader() { if (!this.title && !this.description) { return; } const title = this.slots('title') || this.title; const description = this.slots('description') || this.description; return (