0.1.7 • Published 5 years ago

image-place v0.1.7

Weekly downloads
-
License
-
Repository
-
Last release
5 years ago

vImagePlace

基于vue的图片占位图,懒加载插件

安装

$ npm install vimageplace -S

使用

在 main.js 引入并注册

import vimageplace from "vimageplace";
Vue.use(vimageplace);

之后在组件中使用

<template>
  <imagePlace src="路径" />
</template>

配置

default-src: 默认的占位图,如果图片路径是本地路径,需要用require引用,如:

<imagePlace :default-src="require('../images/test.png')" src="路径" />

src: 要显示的图片路径,配置同default-src。

lazy: 是否启用懒加载,使用方式:

<imagePlace lazy src="路径" />