Skip to content

When To Use ​


  • ImgBox is suitable for images that are not blocked by cross-origin restrictions, especially same-origin assets.
  • It loads the source through an internal request flow, so it can show loading progress.
  • Prefer ImgBox when you want progress feedback and your image source supports this loading mode.

ImgBox-DEMO ​


vue
<fv-ImgBox url="https://placehold.co/350x350/png?text=VFluent+ImgBox+1" style="width: 350px; height: 350px;"></fv-ImgBox>

ImgBox-Background Image ​


vue
<fv-ImgBox url="https://placehold.co/350x350/png?text=VFluent+ImgBox+2" :onbackground="true" style="width: 350px; height: 350px; background-size: cover;"></fv-ImgBox>

ImgBox-Lazy Load ​


vue
<fv-ImgBox url="https://placehold.co/350x350/png?text=VFluent+ImgBox+Lazy" :onlazy="true" style="width: 350px; height: 350px; background-size: cover;"></fv-ImgBox>

Properties ​


PropertyTypeRequiredDefaultDescription
urlstringNo''Image url, be careful don't use cross-domain url
onlazybooleanNofalseLazy load image
loadingColorstringNo'rgba(36, 36, 36, 1)'
onbackgroundbooleanNofalseShow as background
themestringNo'global'See the ImgBox theme option.
disabledbooleanNofalseSee the ImgBox disabled option.
langstringNo"global"See the ImgBox lang option.

Events ​


EventArgumentsDescription
loadobjectTriggered when the image finishes loading.
errorobjectTriggered when the rendered image element fails to load.
load-errorobjectTriggered when the source request fails before the image is ready.

MIT Licensed