emptygif
Language: English

All languages and frameworks

Vue single-file component Vue

A Vue snippet for Vue single-file component that answers requests for /pixel.gif with the empty GIF, decoded once at startup.

Vue single-file component Vue

File
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>

We ran this snippet and compared the bytes it returned.

Official site: Vue single-file component