Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
data-table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
hookehuyr
2022-12-05 16:24:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bb6834751ce5ed55c1d165f9a6e52a4ae1c43717
bb683475
1 parent
76904c97
图片上传控件固定上传类型
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
src/components/ImageUploaderField/index.vue
src/components/ImageUploaderField/index.vue
View file @
bb68347
...
...
@@ -22,7 +22,7 @@
:multiple="item.component_props.multiple"
/>
</div>
<div class="type-text">上传
格式:
{{ type_text }}</div>
<div class="type-text">上传
类型:
{{ type_text }}</div>
<div
v-if="show_empty"
class="van-field__error-message"
...
...
@@ -63,9 +63,13 @@ const props = defineProps({
const emit = defineEmits(["active"]);
const show_empty = ref(false);
// 固定类型限制
const imageTypes = "jpg/jpeg/png/gif/bmp/psd/tif";
// 文件类型中文页面显示
const type_text = computed(() => {
return props.item.component_props.image_type;
// return props.item.component_props.image_type;
return imageTypes;
});
// 上传图片集合
const fileList = ref([
...
...
@@ -78,10 +82,11 @@ const fileList = ref([
// 上传前置处理
const beforeRead = (file) => {
// 类型限制
const image_types = _.map(
props.item.component_props.image_type.split("/"),
(item) => `image/${item}`
);
// const image_types = _.map(
// props.item.component_props.image_type.split("/"),
// (item) => `image/${item}`
// );
const image_types = _.map(imageTypes.split("/"), (item) => `image/${item}`);
let flag = true;
if (_.isArray(file)) {
...
...
Please
register
or
login
to post a comment