emptygif
भाषा: हिन्दी

सभी भाषाएँ और फ़्रेमवर्क

Vue single-file component Vue

Vue single-file component के लिए Vue स्निपेट, जो /pixel.gif पर आने वाली रिक्वेस्ट का जवाब empty GIF से देता है। GIF स्टार्टअप पर एक ही बार डिकोड होता है।

Vue single-file component Vue

फ़ाइल
Spacer.vue
<script setup>
const EMPTY_GIF = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';

defineProps({
  width: { type: Number, default: 1 },
  height: { type: Number, default: 1 },
});
</script>

<template>
  <img :src="EMPTY_GIF" :width="width" :height="height" alt="" aria-hidden="true">
</template>

हमने यह स्निपेट चलाया और इसके लौटाए बाइट्स की तुलना की।

आधिकारिक साइट: Vue single-file component