diff --git a/web/src/hooks/useLayoutModel.ts b/web/src/hooks/useLayoutModel.ts new file mode 100644 index 0000000..997ca1d --- /dev/null +++ b/web/src/hooks/useLayoutModel.ts @@ -0,0 +1,23 @@ +import { computed } from "vue"; +import type { ComputedRef } from "vue"; +import { useDevicesSize } from "@/hooks/useDevicesSize"; + +interface LayoutModel { + formLayout: ComputedRef<"vertical" | "horizontal">; + tableFixed: ComputedRef<"" | "right">; + descriptionsLayout: ComputedRef<"inline-vertical" | "right">; + descriptionsColumn: (min?: number, max?: number) => number; + dialogWidth: (min?: string, max?: string) => string; +} + +export const useLayoutModel = (): LayoutModel => { + const { isMobile } = useDevicesSize(); + + const formLayout = computed(() => (isMobile.value ? "vertical" : "horizontal")); + const tableFixed = computed(() => (isMobile.value ? "" : "right")); + const descriptionsLayout = computed(() => (isMobile.value ? "inline-vertical" : "right")); + const descriptionsColumn = (min: number = 1, max: number = 2) => (isMobile.value ? min : max); + const dialogWidth = (min: string = "40%", max: string = "95%") => (isMobile.value ? max : min); + + return { formLayout, tableFixed, descriptionsLayout, descriptionsColumn, dialogWidth }; +}; diff --git a/web/src/views/about/doc.vue b/web/src/views/about/doc.vue index db28777..8040566 100644 --- a/web/src/views/about/doc.vue +++ b/web/src/views/about/doc.vue @@ -23,6 +23,7 @@ } .card { + min-width: 0; background: $color-bg-2; border: 1px solid $color-border-2; border-radius: 4px; @@ -46,11 +47,17 @@ p { margin: 0; color: $color-text-2; font-size: 14px; + line-height: 1.6; + overflow-wrap: anywhere; + word-break: break-word; } .link { + display: inline; color: $color-link; text-decoration: none; + overflow-wrap: anywhere; + word-break: break-word; } .link:hover { diff --git a/web/src/views/order/detail.vue b/web/src/views/order/components/detail.vue similarity index 90% rename from web/src/views/order/detail.vue rename to web/src/views/order/components/detail.vue index 32c42b7..36b6c27 100644 --- a/web/src/views/order/detail.vue +++ b/web/src/views/order/components/detail.vue @@ -1,5 +1,5 @@