client: tweak ui

This commit is contained in:
syuilo
2021-12-03 13:52:57 +09:00
parent c722225c80
commit 5fe2e8a59a
5 changed files with 32 additions and 29 deletions

View File

@ -7,7 +7,7 @@
</template>
<script lang="ts">
import { defineComponent, onMounted, onUnmounted, ref } from 'vue';
import { defineComponent, inject, onMounted, onUnmounted, ref } from 'vue';
export default defineComponent({
props: {
@ -33,7 +33,13 @@ export default defineComponent({
const root = ref<HTMLElement>();
const content = ref<HTMLElement>();
const margin = ref(0);
const shouldSpacerMin = inject('shouldSpacerMin', false);
const adjust = (rect: { width: number; height: number; }) => {
if (shouldSpacerMin) {
margin.value = props.marginMin;
return;
}
if (rect.width > props.contentMax || rect.width > 500) {
margin.value = props.marginMax;
} else {