- 这里需要先安装shapefile;jszip;turf
npm install shapefile
npm install jszip
npm install @turf/turf
<ElUpload
ref="upload"
v-model:file-list="fileListShp"
:limit="1"
accept=".zip"
:show-file-list="true"
:auto-upload="true"
:on-exceed="() => handleExceed()"
:before-remove="handleRemoveFireShp"
:action="apiPath_fireUpload"
:headers="getFileHeaders()"
name="files"
:before-upload="(file) => beforeAvatarUploadShp('fj', file)"
>
<div class="btn_shp">上传文件</div>
</ElUpload>
<script setup>
import * as turf from '@turf/turf';
import JSZip from 'jszip';
import * as shapefile from 'shapefile'