修改手机端网页样式

This commit is contained in:
whyour
2023-04-06 21:49:42 +08:00
parent 1d2df860e8
commit 59c26d90d3
5 changed files with 14 additions and 9 deletions
+2
View File
@@ -14,11 +14,13 @@ export const useCtx = () => {
setMarginLeft(0);
setMarginTop(0);
setIsPhone(true);
document.body.setAttribute('data-mode', 'phone');
} else {
setWidth('100%');
setMarginLeft(0);
setMarginTop(-72);
setIsPhone(false);
document.body.setAttribute('data-mode', 'desktop');
}
}, []);