Commit f47811c9 authored by chenqikuai's avatar chenqikuai

fix: 限制上传图片的类型

后端只支持png jpg jpeg gif类型的图片,前端需要做个限制。
parent 89efafb6
......@@ -5,7 +5,7 @@
position="bottom"
:close-on-click-overlay="false"
:style="{height: '100%'}">
<input type="file" name="img" @change="change" id="inputbanner" style="display:none;">
<input type="file" name="img" @change="change" id="inputbanner" style="display:none;" accept=".png,.jpg,.gif,.jpeg">
<h5-cropper :option="option" hide-input @getFile="getFile" ref="cropper"></h5-cropper>
<label for="inputbanner">
<div class="add">
......
......@@ -14,7 +14,7 @@
<span>创建模板</span>
</div>
<van-field v-model="templateName" placeholder="填写模板名称"></van-field>
<input type="file" id="thumb" style="display:none" @change="handleFileChange">
<input type="file" id="thumb" style="display:none" @change="handleFileChange" accept=".png,.jpg,.jpeg,.gif">
<label for="thumb" class="file-input" style="padding: 10px 15px;margin:0 17px;">
<common-svg name="tianjia" style="margin-right:10px;"></common-svg>
<span>{{imgUrl ? '已上传': '添加模板封面'}}</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment