1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 20:13:57 +02:00

refactor(frontend): カスタムディレクティブの型付け (#16659)

* refactor(frontend): カスタムディレクティブの型付け

* fix
This commit is contained in:
かっこかり
2025-10-19 11:36:00 +09:00
committed by GitHub
parent 44930342a8
commit d98bf012b5
13 changed files with 158 additions and 94 deletions

View File

@@ -9,8 +9,8 @@ import { globalEvents } from '@/events.js';
const handlerMap = new WeakMap<any, any>();
export default {
mounted(src, binding, vn) {
export const adaptiveBorderDirective = {
mounted(src) {
function calc() {
const parentBg = getBgColor(src.parentElement) ?? 'transparent';
@@ -30,7 +30,7 @@ export default {
globalEvents.on('themeChanged', calc);
},
unmounted(src, binding, vn) {
unmounted(src) {
globalEvents.off('themeChanged', handlerMap.get(src));
},
} as Directive;
} as Directive<HTMLElement>;