项目需求:上传图片并预览,要求可以预览tiff格式的图片。
上传组件用的el-upload,处理tiff格式图片使用了tiff.js
首先,使用npm安装element-ui和tiff.js
npm install element-ui
npm install tiff.js
在main.js中引用elementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI)
上传组件所在的vue页面
<template>
&