vue圖片預覽組件

github代碼地址

vue-preview-img

基於vue的PC端圖片預覽組件,支持拖拽、旋轉和放大縮小。

截圖

使用方式

  1. 安裝
npm i vue-preview-img --save
  1. 在main.js中註冊
import previewImg from 'vue-preview-img'
import '../node_modules/vue-preview-img/lib/vue-preview-img.css'
Vue.use(previewImg)
  1. 調用
// src: 傳入圖片路徑
this.$previewImg({ src: "http://xxxx.jpg" });
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章