minor refactoring

This commit is contained in:
geoffrey45 committed 2021-12-05 22:29:54 +03:00
1 parent 4e2d9fd1e0
commit 843bde1b7e
3 files changed
+91 -92

No files matched your search

+5 -6
View File
@@ -43,23 +43,22 @@ export default {
const songtitle = ref(null);
const songTitleWidth = ref(null);
const minWidth = ref(250);
const minWidth = ref(300);
const songs = Songs.songs;
const resizeSongTitleWidth = () => {
songTitleWidth.value =
songtitle.value.clientWidth > minWidth.value * 4
? songtitle.value.clientWidth / 4
: (songTitleWidth.value = songtitle.value.clientWidth / 3);
let a = songtitle.value.clientWidth;
songTitleWidth.value = a > minWidth.value * 4 ? a / 4 : a / 3;
};
onMounted(() => {
resizeSongTitleWidth();
window.addEventListener("resize", () => {
resizeSongTitleWidth();
});
console.log(songTitleWidth.value);
});
onUnmounted(() => {