修改悬浮按钮显示逻辑
parent
1cf31c634a
commit
6deb44b003
|
|
@ -139,6 +139,7 @@ const model_class = computed(() => {
|
||||||
|
|
||||||
interface com_data {
|
interface com_data {
|
||||||
style: {
|
style: {
|
||||||
|
offset_number_percentage: string,
|
||||||
common_style: {
|
common_style: {
|
||||||
floating_up: number;
|
floating_up: number;
|
||||||
};
|
};
|
||||||
|
|
@ -171,6 +172,7 @@ const model_style = computed(() => {
|
||||||
if (item.com_data.style.common_style?.floating_up != 0) {
|
if (item.com_data.style.common_style?.floating_up != 0) {
|
||||||
z_index = `z-index: 1`;
|
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};`;
|
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};`;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ watch(props.value, (val) => {
|
||||||
|
|
||||||
style.value = location;
|
style.value = location;
|
||||||
// 60 为自身高度
|
// 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 });
|
emits('change', { bottom: new_style.value.offset_number, location: new_style.value.display_location });
|
||||||
}, {immediate: true, deep: true});
|
}, {immediate: true, deep: true});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue