简单插件:

1.安装vue-directive-image-previewer

命令行输入
npm install vue-directive-image-previewer -D

2.main.js中引入

import VueDirectiveImagePreviewer from 'vue-directive-image-previewer'
import 'vue-directive-image-previewer/dist/assets/style.css'
Vue.use(VueDirectiveImagePreviewer) 

3.组件中引用

<template>
  <div>
      <img v-image-preview src="picture-url"/>
  </div>
</template>
Logo

前往低代码交流专区

更多推荐