Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/component/elements/media-gallery/src/ |
Upload File : |
import { ImageItem } from './components/image-item'; import type { ImModelFile } from 'im.v2.model'; const MediaComponents = Object.freeze({ image: 'ImageItem', video: 'ImageItem', }); // @vue/component export const MediaItem = { name: 'MediaItem', components: { ImageItem }, props: { /** @type { ImModelFile } */ file: { type: Object, required: true, }, allowRemove: { type: Boolean, default: false, }, handleLoading: { type: Boolean, default: false, }, }, emits: ['remove', 'cancelClick'], computed: { componentName(): string { return MediaComponents[this.file.type]; }, }, methods: { onRemove(event: { file: ImModelFile }) { this.$emit('remove', event); }, onCancel(event: { file: ImModelFile }) { this.$emit('cancelClick', event); }, }, template: ` <component :is="componentName" :file="file" :allowRemove="allowRemove" :handleLoading="handleLoading" @remove="onRemove" @cancelClick="onCancel" /> `, };