Adapt for Mobile Screen (#14)

This commit is contained in:
AceDataCloud committed 2024-01-02 13:43:30 +08:00
1 parent 82bb30cf94
commit 6de5435746
15 files changed
+355 -152

No files matched your search

+53 -18
View File
@@ -1,25 +1,40 @@
<template>
<div class="wrapper">
<div class="left">
<navigator />
<div class="main">
<div class="side">
<slot name="side">
<side-panel />
</slot>
</div>
<div class="main">
<div class="chat">
<slot name="chat" />
</div>
<el-button round class="menu" @click="drawer = true">
<font-awesome-icon icon="fa-solid fa-bars" class="icon-menu" />
</el-button>
<el-drawer v-model="drawer" :with-header="false" size="340px" class="drawer">
<side-panel />
<router-view />
</div>
</el-drawer>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import Navigator from '@/components/common/Navigator.vue';
import SidePanel from '@/components/chat/SidePanel.vue';
import { ElDrawer, ElButton } from 'element-plus';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
export default defineComponent({
name: 'LayoutChat',
components: {
SidePanel,
Navigator
ElDrawer,
ElButton,
FontAwesomeIcon
},
data() {
return {
drawer: false
};
},
async mounted() {
await this.onGetApplications();
@@ -37,24 +52,44 @@ export default defineComponent({
</script>
<style lang="scss" scoped>
.wrapper {
width: 100%;
height: 100%;
.main {
width: calc(100% - 60px);
display: flex;
flex-direction: row;
.left {
width: 60px;
.side {
width: 300px;
height: 100%;
border-right: 1px solid var(--el-border-color);
overflow-y: scroll;
}
.main {
.chat {
height: 100%;
padding: 15px;
flex: 1;
width: calc(100% - 60px);
width: 100%;
width: calc(100% - 300px);
height: 100%;
display: flex;
flex-direction: row;
flex-direction: column;
}
}
.menu {
display: none;
}
@media (max-width: 767px) {
.side {
display: none;
}
.chat {
width: 100%;
}
.menu {
display: block;
position: fixed;
right: 20px;
top: 20px;
z-index: 2000;
}
}
</style>