vue-photo-preview plug-in components to achieve Click image to enlarge

1. Install

  npm install vue-photo-preview --save

2. Project main.js references

import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
Vue.use(preview)

3. Use in the HTML code

// can be provided directly with the preview attribute
<img src = "xxx.jpg" preview preview-text = " Description">

Guess you like

Origin www.cnblogs.com/Glant/p/10945479.html