123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <script setup>
- import { ref, reactive, toRefs, onMounted} from 'vue'
- const onClickLeft = () => {
- if(props.type=='other'){
- history.back();
- }else{
- window.location.href = '/';
- }
-
- }
- const props = defineProps({
- title: {
- type: String,
- default: '标题'
- },
- type:{
- type: String,
- default:'other'
- }
- })
- </script>
- <template>
- <div>
- <van-nav-bar :title="title" left-arrow @click-left="onClickLeft" class="custom-navbar" />
- </div>
- </template>
- <style scoped>
- /* 自定义导航栏样式 */
- .custom-navbar {
- background-color: #fff;
- color: black;
- position: fixed;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 999;
- }
- /* 更改左侧箭头颜色 */
- .custom-navbar :deep(.van-nav-bar__arrow) {
- color: black;
- }
- .custom-navbar::before,
- .custom-navbar::after {
- display: none !important;
- /* 直接隐藏伪元素 */
- }
- </style>
|