1.0.3 • Published 7 years ago

vue-img-proxy v1.0.3

Weekly downloads
18
License
-
Repository
github
Last release
7 years ago

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 namedescriptiontypedefault value
srcimage urlStringnull
titlewill replace image title alt attrString''

methods

property namedescriptiontypedefault value
loadedimage load finished emitfunctionnull
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago