修改悬浮按钮显示逻辑

v1.0.0
于肖磊 2024-10-16 10:42:54 +08:00
parent 1cf31c634a
commit 6deb44b003
2 changed files with 3 additions and 1 deletions

View File

@ -139,6 +139,7 @@ const model_class = computed(() => {
interface com_data {
style: {
offset_number_percentage: string,
common_style: {
floating_up: number;
};
@ -171,6 +172,7 @@ const model_style = computed(() => {
if (item.com_data.style.common_style?.floating_up != 0) {
z_index = `z-index: 1`;
}
item.com_data.style.offset_number_percentage = (bottom / window.innerHeight).toFixed(4);
return item.key == 'float-window' ? `bottom: ${((bottom / window.innerHeight) * 100).toFixed(4) + '%'};` : `margin-top: -${item.com_data.style.common_style?.floating_up || 0}px;${z_index};`;
};
});

View File

@ -44,7 +44,7 @@ watch(props.value, (val) => {
style.value = location;
// 60
new_style.value.offset_number_percentage = (new_style.value.offset_number / (846 - 60)).toFixed(4);
// new_style.value.offset_number_percentage = (new_style.value.offset_number / (844 - 70)).toFixed(4);
emits('change', { bottom: new_style.value.offset_number, location: new_style.value.display_location });
}, {immediate: true, deep: true});
</script>