Vue single-file component Vue
/pixel.gif 요청에 빈 GIF로 응답하는 Vue single-file component용 Vue 스니펫입니다. GIF는 시작할 때 한 번만 디코딩합니다.
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>
이 스니펫은 실행해 보고, 반환된 바이트를 비교했습니다.