fix img autosize

This commit is contained in:
samunohito 2024-01-29 11:36:34 +09:00
parent de07347087
commit 18abb97f16
3 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,7 @@
:src="cell.value as string" :src="cell.value as string"
:alt="cell.value as string" :alt="cell.value as string"
:class="$style.viewImage" :class="$style.viewImage"
@load="emitContentSizeChanged"
/> />
</div> </div>
</div> </div>
@ -90,6 +91,7 @@ watch(() => [cell, cell.value.value], () => {
// //
nextTick(emitContentSizeChanged); nextTick(emitContentSizeChanged);
}, { immediate: true }); }, { immediate: true });
watch(() => cell.value.selected, () => { watch(() => cell.value.selected, () => {
if (cell.value.selected) { if (cell.value.selected) {
rootEl.value?.focus(); rootEl.value?.focus();

View File

@ -42,7 +42,7 @@ import MkButton from '@/components/MkButton.vue';
const columnSettings: ColumnSetting[] = [ const columnSettings: ColumnSetting[] = [
{ bindTo: 'selected', icon: 'ti-trash', type: 'boolean', editable: true, width: 34 }, { bindTo: 'selected', icon: 'ti-trash', type: 'boolean', editable: true, width: 34 },
{ bindTo: 'url', icon: 'ti-icons', type: 'image', editable: false, width: 50, validators: [required] }, { bindTo: 'url', icon: 'ti-icons', type: 'image', editable: false, width: 'auto', validators: [required] },
{ bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required] }, { bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required] },
{ bindTo: 'category', title: 'category', type: 'text', editable: true, width: 140 }, { bindTo: 'category', title: 'category', type: 'text', editable: true, width: 140 },
{ bindTo: 'aliases', title: 'aliases', type: 'text', editable: true, width: 140 }, { bindTo: 'aliases', title: 'aliases', type: 'text', editable: true, width: 140 },

View File

@ -110,7 +110,7 @@ type RegisterLogItem = {
}; };
const columnSettings: ColumnSetting[] = [ const columnSettings: ColumnSetting[] = [
{ bindTo: 'url', icon: 'ti-icons', type: 'image', editable: true, width: 50, validators: [required] }, { bindTo: 'url', icon: 'ti-icons', type: 'image', editable: true, width: 'auto', validators: [required] },
{ bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required] }, { bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required] },
{ bindTo: 'category', title: 'category', type: 'text', editable: true, width: 140 }, { bindTo: 'category', title: 'category', type: 'text', editable: true, width: 140 },
{ bindTo: 'aliases', title: 'aliases', type: 'text', editable: true, width: 140 }, { bindTo: 'aliases', title: 'aliases', type: 'text', editable: true, width: 140 },
@ -122,7 +122,7 @@ const columnSettings: ColumnSetting[] = [
const registerLogColumnSettings: ColumnSetting[] = [ const registerLogColumnSettings: ColumnSetting[] = [
{ bindTo: 'failed', title: 'failed', type: 'boolean', editable: false, width: 50 }, { bindTo: 'failed', title: 'failed', type: 'boolean', editable: false, width: 50 },
{ bindTo: 'url', icon: 'ti-icons', type: 'image', editable: false, width: 50 }, { bindTo: 'url', icon: 'ti-icons', type: 'image', editable: false, width: 'auto' },
{ bindTo: 'name', title: 'name', type: 'text', editable: false, width: 140 }, { bindTo: 'name', title: 'name', type: 'text', editable: false, width: 140 },
{ bindTo: 'error', title: 'log', type: 'text', editable: false, width: 'auto' }, { bindTo: 'error', title: 'log', type: 'text', editable: false, width: 'auto' },
]; ];