@unicom-blockchain/file-preview
v1.5.5
Published
vue3 element 文件预览组件
Downloads
326
Readme
FileExplorer
安装
pnpm i @unicom-blockchain/file-preview
使用
<template>
<div>
<FilePreview ref="previewRef"></FilePreview>
<button @click="preview"></button>
</div>
</template>
<script setup lang="ts">
import { FilePreview } from '@unicom-blockchain/file-preview';
import { ref } from 'vue';
const previewRef = ref<InstanceType<typeof FilePreview>>();
function preview() {
if (previewRef.value) {
previewRef.value.preview(
{
name: 'aaa.png',
type: 'file',
contentType: 'image/png',
},
new Blob(),
);
}
}
</script>
<style scoped></style>