This commit is contained in:
A1300399510
2023-07-10 19:02:29 +08:00
parent ea2dff01f3
commit ba761c23b9
10 changed files with 416 additions and 247 deletions

View File

@@ -1,38 +1,17 @@
<template>
<header-nav v-if="isHeader === 1"></header-nav>
<router-view />
</template>
<script>
import { onMounted, watch, ref, } from 'vue';
import { useRoute } from 'vue-router';
import headerNav from './components/public/head.vue'
export default ({
setup() {
const route = useRoute();
let isHeader = ref(0) // 判断头部是否需要展示和状态 编辑头部和首页收不不也一样 0 为不显示 1 是编辑页面的小头部 2 是大头部
// 监听路径变化
watch(
() => route.path,
(newValue) => {
if (newValue === '/edit') isHeader.value = 1
}
);
return {
isHeader,
route // 在Vue 3中需要手动从Vue实例中导入 $route
}
},
data() {
return {
};
},
components: {
headerNav
}
})
@@ -44,9 +23,14 @@ export default ({
box-sizing: border-box;
}
a {
text-decoration: none;
}
html {
background-color: #eff7ff;
}
img {
object-fit: contain;
}
@@ -85,6 +69,10 @@ img {
justify-content: center;
}
.wid1200 {
width: 1200px;
}
/* // 全局css 加上以下代码,可以隐藏上下箭头 */
/* // 取消input的上下箭头 */