hookehuyr

文件上传模块设置禁用属性

1 <!-- 1 <!--
2 * @Date: 2022-08-31 16:16:49 2 * @Date: 2022-08-31 16:16:49
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-12-30 12:58:48 4 + * @LastEditTime: 2022-12-30 16:53:12
5 * @FilePath: /data-table/src/components/FileUploaderField/index.vue 5 * @FilePath: /data-table/src/components/FileUploaderField/index.vue
6 * @Description: 文件上传控件 6 * @Description: 文件上传控件
7 --> 7 -->
8 <template> 8 <template>
9 - <div class="file-uploader-field"> 9 + <div v-if="HideShow" class="file-uploader-field">
10 <div class="label"> 10 <div class="label">
11 {{ item.component_props.label 11 {{ item.component_props.label
12 }}<span v-if="item.component_props.required">&nbsp;*</span> 12 }}<span v-if="item.component_props.required">&nbsp;*</span>
...@@ -81,6 +81,10 @@ const $route = useRoute(); ...@@ -81,6 +81,10 @@ const $route = useRoute();
81 const props = defineProps({ 81 const props = defineProps({
82 item: Object, 82 item: Object,
83 }); 83 });
84 +// 隐藏显示
85 +const HideShow = computed(() => {
86 + return !props.item.component_props.disabled
87 +})
84 const emit = defineEmits(["active"]); 88 const emit = defineEmits(["active"]);
85 const show_empty = ref(false); 89 const show_empty = ref(false);
86 90
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 * @Description: 图片上传控件 6 * @Description: 图片上传控件
7 --> 7 -->
8 <template> 8 <template>
9 - <div class="image-uploader-field"> 9 + <div v-if="HideShow" class="image-uploader-field">
10 <div class="label"> 10 <div class="label">
11 {{ item.component_props.label 11 {{ item.component_props.label
12 }}<span v-if="item.component_props.required">&nbsp;*</span> 12 }}<span v-if="item.component_props.required">&nbsp;*</span>
...@@ -66,6 +66,10 @@ const $route = useRoute(); ...@@ -66,6 +66,10 @@ const $route = useRoute();
66 const props = defineProps({ 66 const props = defineProps({
67 item: Object, 67 item: Object,
68 }); 68 });
69 +// 隐藏显示
70 +const HideShow = computed(() => {
71 + return !props.item.component_props.disabled
72 +})
69 const emit = defineEmits(["active"]); 73 const emit = defineEmits(["active"]);
70 const show_empty = ref(false); 74 const show_empty = ref(false);
71 75
......