使用vue一个组件vue-directive-image-previewer
A Vue.js project for tag img, click img to zoom out to full screen.
安装vue-directive-image-previewer
命令行
npm install vue-directive-image-previewer -D
main.js
import VueDirectiveImagePreviewer from 'vue-directive-image-previewer'
import 'vue-directive-image-previewer/dist/assets/style.css'
Vue.use(VueDirectiveImagePreviewer)
components
<template>
<div>
<img v-image-preview src="picture-url"/>
</div>
</template>
网友评论