添加上传图片文件的验证

This commit is contained in:
熊丽君
2021-10-20 09:28:09 +08:00
parent 9b416ac846
commit f0b9b83d4c
3 changed files with 12 additions and 2 deletions

View File

@ -96,6 +96,10 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
}, },
beforeUpload(file) { beforeUpload(file) {
if (file.type.indexOf('image/') == -1) {
this.msgError('文件格式错误,请上传图片类型,如JPGPNG后缀的文件。');
return false;
}
// const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1); // const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1);
// const whiteList = ['pdf', 'doc', 'docx', 'xls', 'xlsx']; // const whiteList = ['pdf', 'doc', 'docx', 'xls', 'xlsx'];
// if (whiteList.indexOf(fileSuffix) === -1) { // if (whiteList.indexOf(fileSuffix) === -1) {

View File

@ -75,8 +75,10 @@
</el-form-item> </el-form-item>
<el-form-item label="详细地址"> <el-form-item label="详细地址">
<el-input <el-input
type="textarea"
v-model="form.address" v-model="form.address"
maxlength="25" :autosize="{ minRows: 3, maxRows: 4 }"
maxlength="80"
show-word-limit show-word-limit
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -282,6 +284,9 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
/deep/.el-input__count {
background-color: unset;
}
.info_page { .info_page {
.box { .box {
display: flex; display: flex;

View File

@ -516,10 +516,11 @@ export default {
// height: 50px; // height: 50px;
// line-height: 50px; // line-height: 50px;
display: flex; display: flex;
align-items: center; // align-items: center;
padding: 0 20px; padding: 0 20px;
.text_col { .text_col {
// min-width: 70px; // min-width: 70px;
margin: 15px 0 0;
color: #333; color: #333;
font-size: 18px; font-size: 18px;
} }