fix: index out of range on cancel
This commit is contained in:
parent
1b8393784b
commit
c44dc9aaf3
1 changed files with 1 additions and 13 deletions
|
|
@ -55,6 +55,7 @@ function change(e: Event) {
|
||||||
const _file = _element?.files?.[0];
|
const _file = _element?.files?.[0];
|
||||||
|
|
||||||
if (_file) {
|
if (_file) {
|
||||||
|
currentIndex.value = file.length + 1;
|
||||||
const reader = new FileReader();
|
const reader = new FileReader();
|
||||||
reader.readAsDataURL(_file);
|
reader.readAsDataURL(_file);
|
||||||
reader.onload = () => {
|
reader.onload = () => {
|
||||||
|
|
@ -125,19 +126,6 @@ const { pdf, pages } = usePDF(computed(() => currentFile.value?.url));
|
||||||
@click="
|
@click="
|
||||||
() => {
|
() => {
|
||||||
currentIndexDropdownList = i;
|
currentIndexDropdownList = i;
|
||||||
currentIndex = file.length + 1;
|
|
||||||
|
|
||||||
// const _idx = file.findIndex(
|
|
||||||
// (v: any) => v.group === dropdownList?.[i].value,
|
|
||||||
// );
|
|
||||||
// if (_idx !== -1) {
|
|
||||||
// currentIndex = _idx;
|
|
||||||
// } else {
|
|
||||||
// file.push({
|
|
||||||
// group: dropdownList?.[i].value || 'other',
|
|
||||||
// });
|
|
||||||
// currentIndex = file.length - 1;
|
|
||||||
// }
|
|
||||||
browse();
|
browse();
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue