布局优化

上级 50252463
<template>
<div class="home-container">
<!-- 头部区域 -->
<MyHeader></MyHeader>
<!-- 页面主体区域 -->
<div class="home-main-box">
<!-- 左侧边栏 -->
<MyAside></MyAside>
<!-- 右侧内容主体区域 -->
<div class="home-main-body">
<el-row>
<el-col :span="24">
<!-- 头部区域 -->
<MyHeader></MyHeader>
</el-col>
</el-row>
<el-row>
<el-col :span="3">
<!-- 左侧边栏 -->
<MyAside></MyAside>
</el-col>
<el-col :span="21">
<!-- 主体区域 -->
<router-view></router-view>
</div>
</div>
</el-col>
</el-row>
</div>
</template>
<script>
// 头部区域组件
import MyHeader from './subcomponents/MyHeader.vue'
import MyHeader from "./subcomponents/MyHeader.vue";
// 左侧边栏组件
import MyAside from './subcomponents/MyAside.vue'
import MyAside from "./subcomponents/MyAside.vue";
export default {
name: 'MyHome',
name: "MyHome",
// 注册组件
components: {
MyHeader,
MyAside
}
}
MyAside,
},
};
</script>
<style lang="less" scoped>
......
<template>
<div>
<el-container>
<el-header style="text-align: right; font-size: 12px">
<!-- <el-header style="text-align: right; font-size: 12px">
<i class="el-icon-refresh header-button-item" @click="refreshPage"></i>
<el-dropdown>
<i class="el-icon-setting header-button-item"></i>
......@@ -15,7 +15,7 @@
class="header-button-item"
>kwan</a
>
</el-header>
</el-header> -->
<el-main>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
......@@ -40,7 +40,7 @@
<el-table-column
prop="id"
label="序号"
width="50"
width="100"
sortable
></el-table-column>
<el-table-column
......@@ -99,7 +99,7 @@ export default {
loading: false,
elementui_page_component_key: 0,
currentPage: Number(localStorage.getItem("lastPage")) || 1,
pageSize: 14,
pageSize: 10,
total: 0,
formInline: {
question: "",
......@@ -118,7 +118,8 @@ export default {
created() {
this.$nextTick(() => {
const foo = this.$route.query.back;
if (foo === "back") {
const add = this.$route.query.add;
if (foo === "back" && add != "add") {
this.currentPage = Number(localStorage.getItem("lastPage")) || 1;
this.formInline.question = localStorage.getItem("lastQuestion") || "";
} else {
......@@ -135,7 +136,6 @@ export default {
this.currentPage = Number(localStorage.getItem("lastPage")) || 1;
this.formInline.question = localStorage.getItem("lastQuestion");
this.elementui_page_component_key++;
this.initCartList();
},
methods: {
async onDelete(id) {
......
......@@ -9,7 +9,9 @@
<!-- 标题 -->
<h4 class="layout-header-left-title ml-3">kwan的解忧杂货铺</h4>
</div>
<a href="http://qinyingjie.top/" target="_blank" class="header-button-item"
>kwan</a
>
<!-- 右侧按钮区域 -->
<div class="layout-header-right">
<button type="button" class="btn btn-light" @click="logout">
......
<template>
<div>
<el-button @click="goBack()">后退</el-button>
<el-button @click="goBack">后退</el-button>
<h4 class="text-center">新增ChatGpt问答</h4>
<el-container class="container">
<el-form ref="form" :model="form" label-width="80px">
......@@ -64,6 +64,7 @@ export default {
const params = {
// 参数名: 参数值
back: "back",
add: "add",
};
// 使用 $router.push() 导航到前一个页面
this.$router.push({
......@@ -82,4 +83,4 @@ export default {
align-items: center;
height: 30vh; /* 如果希望 `el-container` 在整个视口居中,可以使用 height: 100vh; 来设置容器的高度 */
}
</style>
</style>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册