npm 安装:
npm i –save y-image
属性:
loadUrl: 加载中显示的图片Url
errorUrl: 加载失败显示的图片Url
picUrl: 需要加载的图片Url
通过给y-imge设置不同的Url自动根据不用状态显示不同Url的图片
Example
html
<div>
<y-image :picUrl="picUrl"></y-image>
</div>
JavaScript
<script> import YImage from 'y-image' export default { components: {YImage}, data () { return { picUrl: 'http://img.zcool.cn/community/0117e2571b8b246ac72538120dd8a4.jpg@1280w_1l_2o_100sh.jpg' } } } </script>
npm地址: https://www.npmjs.com/package/y-image
github地址: https://github.com/yanwosky4/y-image
yanwosky4 yanwosky4@gmail.com
欢迎star,欢迎issue
参考链接:
https://blog.csdn.net/aj1031689/article/details/27353461