fix add-point-card invalid
This commit is contained in:
@@ -25,9 +25,10 @@
|
||||
:add-text="props.addText ?? '选择文件'"
|
||||
:busy="isBusy"
|
||||
:upload-enabled="!!props.upload"
|
||||
@add="emit('add')"
|
||||
@capture-photo="emit('capture-photo')"
|
||||
@capture-video="emit('capture-video')"
|
||||
@add="handleAdd"
|
||||
@action="handleAddAction"
|
||||
@capture-photo="handleCapturePhoto"
|
||||
@capture-video="handleCaptureVideo"
|
||||
@file-change="handleFileChange"
|
||||
/>
|
||||
</div>
|
||||
@@ -90,13 +91,32 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
});
|
||||
|
||||
type Emits = {
|
||||
(event: string): void;
|
||||
(event: "update:modelValue", value: string[]): void;
|
||||
(event: "update:photoItems", value: PhotoItem[]): void;
|
||||
add: [];
|
||||
action: [value: MediaSelectorAddAction];
|
||||
"capture-photo": [];
|
||||
"capture-video": [];
|
||||
"update:modelValue": [value: string[]];
|
||||
"update:photoItems": [value: PhotoItem[]];
|
||||
};
|
||||
|
||||
const emit = defineEmits<Emits>();
|
||||
|
||||
function handleAddAction(action: MediaSelectorAddAction): void {
|
||||
emit("action", action);
|
||||
}
|
||||
|
||||
function handleAdd(): void {
|
||||
emit("add");
|
||||
}
|
||||
|
||||
function handleCapturePhoto(): void {
|
||||
emit("capture-photo");
|
||||
}
|
||||
|
||||
function handleCaptureVideo(): void {
|
||||
emit("capture-video");
|
||||
}
|
||||
|
||||
const photoViewerVisible = ref(false);
|
||||
const photoViewerImages = ref<string[]>([]);
|
||||
const photoViewerItems = ref<MediaSelectorViewerItem[]>([]);
|
||||
|
||||
Reference in New Issue
Block a user