0.1.5 • Published 5 years ago
@wozien/vue-image-preview v0.1.5
基于 vue.js 实现的网页图片预览组件,支持拖拽,滚动缩放
开始使用
下载
npm install @wozien/vue-image-preview
引入组件
<template>
<div id="#app">
<v-image-preview
ref="preview"
:images="images"
:start-index="index"
:can-wheel="canWheel"
></v-image-preview>
</div>
</template>
<script>
import VImagePreview from '@wozien/vue-image-preview';
export default {
name: 'app',
data() {
return {
images: ['.../a.jpg', '.../b.jpg'],
index: 0,
canWheel: false
};
},
methods: {
show() {
this.$refs.preview.show();
}
}
};
</script>