fix require photo event
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
<template>
|
||||
<div v-bind="$attrs" class="photo-scroller">
|
||||
<div class="t-form__label" v-text="title" />
|
||||
<div class="t-form__label" :class="{ required }">
|
||||
<slot name="title">
|
||||
<span v-text="title" />
|
||||
</slot>
|
||||
</div>
|
||||
<div class="photo-shell" :class="{ 'without-add': !showAdd }">
|
||||
<div class="items">
|
||||
<div v-if="!displayPhotoList.length" class="empty" v-text="emptyText" />
|
||||
@@ -157,6 +161,7 @@ interface Props {
|
||||
loading?: boolean;
|
||||
modelValue: string[];
|
||||
photoItems?: readonly PhotoItem[];
|
||||
required?: boolean;
|
||||
showViewerActions?: boolean;
|
||||
showAdd?: boolean;
|
||||
showRemove?: boolean;
|
||||
@@ -188,6 +193,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
editMode: false,
|
||||
emptyText: "暂无照片",
|
||||
loading: false,
|
||||
required: false,
|
||||
showAdd: true,
|
||||
showRemove: true,
|
||||
showViewerActions: true
|
||||
@@ -412,6 +418,14 @@ function normalizePhotoItem(item: PhotoItem): PhotoItem {
|
||||
}
|
||||
}
|
||||
|
||||
.t-form__label {
|
||||
&.required::before {
|
||||
color: var(--td-error-color, #e34d59);
|
||||
content: "*";
|
||||
margin-right: .25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.add-trigger {
|
||||
--td-popover-padding: 0 .5rem;
|
||||
width: 5.5rem;
|
||||
|
||||
Reference in New Issue
Block a user