Skip to content

This is an Img tag developed based on Vue3 with caching function, this component will help you store all the requested images in indexedb with url as the key, and the network request will not be made again when you access it for the second time

License

Notifications You must be signed in to change notification settings

Ruy5/img-cache-v3

Repository files navigation

ImgCacheV3

安装

npm i img-cache-v3

main.js中引入

import ImgCache from 'img-cache-v3'

const app = createApp(App)
app.use(ImgCache)
app.mount('#app')

Vue组件中使用

<script setup>

</script>

<template>
  <ImgCache src="/vite.svg"/>
</template>

<style scoped>

</style>

参数列表

属性名 说明 类型
src 图片源地址,同原生属性一致 String
fit 确定图片如何适应容器框,同原生 object-fit String
alt 原生属性 alt String
style 样式 Object

About

This is an Img tag developed based on Vue3 with caching function, this component will help you store all the requested images in indexedb with url as the key, and the network request will not be made again when you access it for the second time

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published