1.0.5 • Published 6 years ago

vue-imgmode v1.0.5

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

description

这是一个简单的针对图片显示的组件,模仿了微信小程序组件<image/>的思路,让图片按照你的配置显示

安装

npm install vue-imgmode --save

Usage

步骤一

在 main.js 入口文件引入

import VueImgmode from 'vue-imgmode'
Vue.use(VueImgmode)

步骤二

在组件中即可使用
<vue-imgmode :mode="imgmode" :width="`300px`" :height="`200px`"  :src="require('@/assets/logo.png')"></vue-imgmode>

Attributes:

mode 可选值:

example

#### 组件里面加入插槽 可以用来添加小图标等

<template>
    <vue-imgmode :mode="imgmode" :width="`300px`" :height="`200px`"  :src="src">
       <div style="width: 10px;height: 10px;background: red;position: absolute;left: 0;top:0;z-index: 9">小图标</div>
    </vue-imgmode>
</template>

<script>
    export default {
        name: 'DoImgmode',
        data () {
            return {
                imgmode: 'aspectFit',
                src: require('@/assets/logo.png')
            }
        }
    }
</script>
1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago