Vue single-file component Vue
Uno snippet Vue per Vue single-file component che risponde alle richieste a /pixel.gif con la GIF vuota, decodificata una sola volta all'avvio.
Vue single-file component 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>
Abbiamo eseguito questo snippet e confrontato i byte che ha restituito.