更新页面
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:class="item.elTagType"
|
||||
@click="handleItem(item)"
|
||||
>{{ item.label || item.zdmc }}</span>
|
||||
<el-tag
|
||||
v-else
|
||||
@ -14,6 +15,7 @@
|
||||
:key="item.value + ''"
|
||||
:index="index"
|
||||
:type="item.elTagType === 'primary' ? '' : item.elTagType"
|
||||
@click="handleItem(item)"
|
||||
:class="item.elTagType"
|
||||
>{{ item.label || item.zdmc }}</el-tag
|
||||
>
|
||||
@ -23,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import { computed,defineEmits } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
// 数据
|
||||
@ -35,6 +37,8 @@ const props = defineProps({
|
||||
value: [Number, String, Array]
|
||||
});
|
||||
|
||||
const emit = defineEmits(['clickTag'])
|
||||
|
||||
const values = computed(() => {
|
||||
if (props.value !== null && typeof props.value !== "undefined") {
|
||||
return Array.isArray(props.value) ? props.value : [String(props.value)];
|
||||
@ -42,6 +46,11 @@ const values = computed(() => {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
// 处理数据
|
||||
const handleItem = (item) =>{
|
||||
emit('clickTag',item)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
@ -186,8 +186,6 @@ const headers = ref({
|
||||
|
||||
onMounted(() => {
|
||||
if (props.modelValue) {
|
||||
console.log(props.modelValue,'==========props.modelValue');
|
||||
console.log(fileList.value,'====键');
|
||||
fileList.value = props.modelValue.map((el) => {
|
||||
return {
|
||||
url: `/mosty-api/mosty-base/minio/image/download/` + el
|
||||
@ -202,9 +200,9 @@ const handlerSuccess = (res, file) => {
|
||||
fileList.value.push(file);
|
||||
props.modelValue.push(res.data);
|
||||
emits("handleChange", props.modelValue);
|
||||
// emits("update:modelValue", props.modelValue);
|
||||
emits("update:modelValue", props.modelValue);
|
||||
};
|
||||
const handlePreview = (file) => {};
|
||||
|
||||
const handleExceed = (files, fileList) => {
|
||||
ElMessage.warning(`限制,只能上传${props.limit}个文件或图片`);
|
||||
};
|
||||
@ -245,7 +243,7 @@ const handleRemove = (file) => {
|
||||
fileList.value.splice(index, 1);
|
||||
props.modelValue.splice(index, 1);
|
||||
emits("handleChange", props.modelValue);
|
||||
// emits("update:modelValue", props.modelValue);
|
||||
emits("update:modelValue", props.modelValue);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user