<template>
	<VScaleScreen width="1920" height="1080" style="background-color: #fff">
		<router-view />
	</VScaleScreen>
</template>
<script lang="ts" setup>
import VScaleScreen from 'v-scale-screen';

const debounce = (callback: (...args: any[]) => void, delay: number) => {
	let tid: any;
	return function (...args: any[]) {
		const ctx = self;
		tid && clearTimeout(tid);
		tid = setTimeout(() => {
			callback.apply(ctx, args);
		}, delay);
	};
};

const _ = (window as any).ResizeObserver;
(window as any).ResizeObserver = class ResizeObserver extends _ {
	constructor(callback: (...args: any[]) => void) {
		callback = debounce(callback, 20);
		super(callback);
	}
};
</script>
<style lang="scss"></style>
