npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vue-ele-image

v1.0.2

Published

对 element-ui image组件进一步封装, 使其更简单、易用

Readme

vue-ele-image | 使 element-ui image 组件更简单、好用

license npm size download

特点

  • 增加 avatar 模式
  • 可全局定义配置(lazy, fit 等)
  • 参数更简单(size, radius 等)
  • 保留所有 el-image 的特性

'ele-image'

在线示例

https://codepen.io/dream2023/pen/GbKjBa

安装

npm install vue-ele-image --save

用法

// 全局 (推荐)
import EleImage from 'vue-ele-image'

// 可以配置全局默认值(配置中每一项都是可选)
Vue.use(EleImage, {
  fit: 'cover',
  lazy: true,
  color: '#fff',
  defaultSrc: 'https://dwz.cn/QYY2qkts',
  backgroundColor: '#409EFF'
})
// 局部导入
// 这里注意要有 {} 括号
import { EleImage } from 'vue-ele-image'

export default {
  components: {
    EleImage
  }
}

示例

<!-- 普通用法 -->
<ele-image
  :size="100"
  src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
/>
<!-- avatar模式(无src时) -->
<ele-image :size="50" username="zhang" src="" />
<!-- 加载失败(同官网一样, 包括其他特性) -->
<el-image>
  <div slot="error" class="image-slot">
    <i class="el-icon-picture-outline"></i>
  </div>
</el-image>

Props 参数

props: {
  username: String, // 当src不存在时, avatar模式所显示的字符
  color: String, // avatar模式下, 字体颜色
  backgroundColor: String, // avatar模式下, 背景色
  size: Number, // size相当于 width === height === size
  width: Number, // 如果给定width值, 会覆盖size值
  height: Number, // 如果给定height值, 会覆盖size值
  radius: String, // 圆角, 正常模式默认值 5px, 头像模式: 50%
  defaultSrc: String, // 当src不存在时, 顶替src
  customStyle: Object, // 自定义样式
  src: String, // 同官网
  alt: String, // 同官网
  fit: String, // 同官网
  lazy: Boolean, // 同官网
  referrerPolicy: String, // 同官网
  scrollContainer: [String, Object], // 同官网
}

Events 事件(同官网)

Slots 插槽(同官网)

相关链接