提交
This commit is contained in:
32
src/App.vue
32
src/App.vue
@@ -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的上下箭头 */
|
||||
|
||||
Reference in New Issue
Block a user