From f8ed6b1a541decb4ebef7b7dec5bab6c72f28e09 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 8 May 2023 18:30:40 +0900 Subject: [PATCH] refactor --- packages/frontend/src/components/MkWindow.vue | 4 ++-- packages/frontend/src/directives/container.ts | 21 ------------------- packages/frontend/src/directives/index.ts | 2 -- packages/frontend/src/pages/channel.vue | 2 +- packages/frontend/src/pages/my-lists/list.vue | 2 +- packages/frontend/src/ui/deck/column.vue | 4 ++-- packages/frontend/src/ui/universal.vue | 4 ++-- 7 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 packages/frontend/src/directives/container.ts diff --git a/packages/frontend/src/components/MkWindow.vue b/packages/frontend/src/components/MkWindow.vue index 687abed632..b662479b2a 100644 --- a/packages/frontend/src/components/MkWindow.vue +++ b/packages/frontend/src/components/MkWindow.vue @@ -29,7 +29,7 @@ -
+
@@ -541,7 +541,7 @@ defineExpose({ flex: 1; overflow: auto; background: var(--panel); - container-type: inline-size; + container-type: size; } $handleSize: 8px; diff --git a/packages/frontend/src/directives/container.ts b/packages/frontend/src/directives/container.ts deleted file mode 100644 index a8a93eb9be..0000000000 --- a/packages/frontend/src/directives/container.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Directive } from 'vue'; - -const map = new WeakMap(); - -export default { - mounted(el: HTMLElement, binding, vn) { - const ro = new ResizeObserver((entries, observer) => { - el.style.setProperty('--containerHeight', el.offsetHeight + 'px'); - }); - ro.observe(el); - map.set(el, ro); - }, - - unmounted(el, binding, vn) { - const ro = map.get(el); - if (ro) { - ro.disconnect(); - map.delete(el); - } - }, -} as Directive; diff --git a/packages/frontend/src/directives/index.ts b/packages/frontend/src/directives/index.ts index 064ee4f64b..7847d661d4 100644 --- a/packages/frontend/src/directives/index.ts +++ b/packages/frontend/src/directives/index.ts @@ -11,7 +11,6 @@ import clickAnime from './click-anime'; import panel from './panel'; import adaptiveBorder from './adaptive-border'; import adaptiveBg from './adaptive-bg'; -import container from './container'; export default function(app: App) { for (const [key, value] of Object.entries(directives)) { @@ -32,5 +31,4 @@ export const directives = { 'panel': panel, 'adaptive-border': adaptiveBorder, 'adaptive-bg': adaptiveBg, - 'container': container, }; diff --git a/packages/frontend/src/pages/channel.vue b/packages/frontend/src/pages/channel.vue index 0a2f66d4fc..af1b4d2056 100644 --- a/packages/frontend/src/pages/channel.vue +++ b/packages/frontend/src/pages/channel.vue @@ -206,7 +206,7 @@ definePageMetadata(computed(() => channel ? { diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue index 2462967515..1fd63910a8 100644 --- a/packages/frontend/src/ui/universal.vue +++ b/packages/frontend/src/ui/universal.vue @@ -2,10 +2,10 @@
- +
-
+