github代碼位址
vue-preview-img
基于vue的PC端圖檔預覽元件,支援拖拽、旋轉和放大縮小。

使用方式
- 安裝
npm i vue-preview-img --save
- 在main.js中注冊
import previewImg from 'vue-preview-img'
import '../node_modules/vue-preview-img/lib/vue-preview-img.css'
Vue.use(previewImg)
- 調用
// src: 傳入圖檔路徑
this.$previewImg({ src: "http://xxxx.jpg" });