תיעוד למפתחים: Vue
עוזר ההעלאה
Vue
הקטנת קובצי PDF ותמונות לפני העלאה באפליקציית Vue, עם מאפיין אחד על שדה הקובץ או על אזור הגרירה.
טוענים את הסקריפט פעם אחת ב-index.html, ואז מוסיפים את המאפיין לשדה הקלט או לאזור הגרירה. הפונקציות שמטפלות באירועים מקבלות את הקובץ המוקטן.
index.html
<script src="https://pdfkind.com/embed.js" defer></script>שדה קובץ
Vue
<template>
<input type="file" data-pdfkind-max="5MB" @change="onFile" />
</template>
<script setup>
function onFile(e) {
upload(e.target.files[0]) // הקובץ המוקטן
}
</script>אזור גרירה
Vue
<div data-pdfkind-max="5MB" @dragover.prevent @drop.prevent="onDrop">
שחררו כאן את המסמך
</div>
<script setup>
function onDrop(e) {
upload(e.dataTransfer.files[0])
}
</script>לשליטה מלאה, השתמשו ב-PDFkind.fit().
עודכן לאחרונה: 3 בנובמבר 2026 · שאלות: contact@pdfkind.com