emptygif
언어: 한국어

모든 언어 및 프레임워크

Vue single-file component Vue

/pixel.gif 요청에 빈 GIF로 응답하는 Vue single-file component용 Vue 스니펫입니다. 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