feat: 移动端兼容优化
This commit is contained in:
@@ -752,14 +752,17 @@ function toggleSidebar() {
|
|||||||
.aside-container {
|
.aside-container {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: var(--header-container-default-height, 64px);
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
width: 280px !important;
|
width: 280px !important;
|
||||||
|
max-width: 80vw;
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
|
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
|
||||||
&.aside-collapsed {
|
&.aside-collapsed {
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
@@ -773,6 +776,7 @@ function toggleSidebar() {
|
|||||||
|
|
||||||
.aside-wrapper {
|
.aside-wrapper {
|
||||||
width: 280px !important;
|
width: 280px !important;
|
||||||
|
max-width: 80vw;
|
||||||
|
|
||||||
.aside-collapsed & {
|
.aside-collapsed & {
|
||||||
width: 100px !important;
|
width: 100px !important;
|
||||||
@@ -782,7 +786,7 @@ function toggleSidebar() {
|
|||||||
// 移动端遮罩层
|
// 移动端遮罩层
|
||||||
.aside-overlay {
|
.aside-overlay {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: var(--header-container-default-height, 64px);
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
|||||||
@@ -195,6 +195,8 @@ function toggleMobileMenu() {
|
|||||||
direction="rtl"
|
direction="rtl"
|
||||||
:size="280"
|
:size="280"
|
||||||
:close-on-click-modal="true"
|
:close-on-click-modal="true"
|
||||||
|
:lock-scroll="true"
|
||||||
|
:modal-class="'mobile-drawer-modal'"
|
||||||
class="mobile-drawer"
|
class="mobile-drawer"
|
||||||
>
|
>
|
||||||
<template #header>
|
<template #header>
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ const sessionId = computed(() => route.params?.id);
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100vh - var(--header-container-default-height));
|
height: calc(100vh - var(--header-container-default-height));
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,4 +40,18 @@ const sessionId = computed(() => route.params?.id);
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 移动端优化 */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.conversation-page {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-content {
|
||||||
|
width: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,7 +9,21 @@
|
|||||||
// el 弹框不知道为啥宽度会变大
|
// el 弹框不知道为啥宽度会变大
|
||||||
.el-popup-parent--hidden {
|
.el-popup-parent--hidden {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
overflow: hidden;
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 移动端 Drawer 遮罩层样式修复
|
||||||
|
.mobile-drawer-modal {
|
||||||
|
z-index: 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 防止移动端 drawer 打开时页面溢出
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
body.el-popup-parent--hidden {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
//需要重写的样式放这里
|
//需要重写的样式放这里
|
||||||
.elx-xmarkdown-container {
|
.elx-xmarkdown-container {
|
||||||
padding: 0 ;
|
padding: 0 ;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
.el-bubble-content p{
|
.el-bubble-content p{
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
@@ -11,6 +13,9 @@
|
|||||||
font-size: 16px !important;
|
font-size: 16px !important;
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
line-height: 28px !important;
|
line-height: 28px !important;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
.chat-with-id-container{
|
.chat-with-id-container{
|
||||||
//待定
|
//待定
|
||||||
@@ -18,7 +23,52 @@
|
|||||||
}
|
}
|
||||||
.el-bubble-content-wrapper {
|
.el-bubble-content-wrapper {
|
||||||
--bubble-content-max-width: 800px;
|
--bubble-content-max-width: 800px;
|
||||||
|
max-width: 100%;
|
||||||
}
|
}
|
||||||
.markdown-language-header-div{
|
.markdown-language-header-div{
|
||||||
z-index: 0 !important;
|
z-index: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 移动端 markdown 优化 */
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.el-bubble-content-wrapper {
|
||||||
|
--bubble-content-max-width: 100%;
|
||||||
|
max-width: calc(100vw - 80px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-bubble-content {
|
||||||
|
font-size: 14px !important;
|
||||||
|
line-height: 24px !important;
|
||||||
|
padding: 8px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.elx-xmarkdown-container {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* markdown 内容元素优化 */
|
||||||
|
.markdown-body {
|
||||||
|
font-size: 14px !important;
|
||||||
|
|
||||||
|
pre {
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user