Skip to content
This repository has been archived by the owner on Nov 23, 2022. It is now read-only.

simsir-lin/vue-img-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vue-img-proxy

VersionDownloads

这是一个Vue2.x的图片代理组件,当你的页面有图片显示时,发送http请求图片url时必须等待服务器返回才可,使用该组件可图片未加载完成前先显示一张默认图片,图片加载完成后再替换掉默认图片,如果图片加载失败则替换为加载失败的图片


Install

npm install vue-img-proxy --save

Usage

install as global component

import Vue from 'vue'
import VueImgProxy from 'vue-img-proxy'

Vue.component('VueImgProxy', VueImgProxy)

install as something component

import VueImgProxy from 'vue-img-proxy'

const app = new Vue({
    components: { VueImgProxy }
})

template code

<vue-img-proxy :src="img" :title="title" @loaded=""></vue-img-proxy>

API

Attributes

property name description type default value
src image url String null
title will replace image title alt attr String ''

methods

property name description type default value
loaded image load finished emit function null

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages