Liuyi
2024-11-30 493d712b9b7d7821e71f9fee6f2078e023ef4f5f
components/navbar/navbar.vue
@@ -1,15 +1,14 @@
<template>
   <view class="navbar">
      <image src="../../static/images/addCard/back.png" alt="" @click="navBackToChild()"></image>
      <image src="../../static/images/other/navBack.svg" alt="" @click="navBackTo()"></image>
      <text>{{title}}</text>
   </view>
</template>
<script setup>
   import { ref } from 'vue'
   const emit = defineEmits(['navBackTo'])
   function navBackToChild(){
      emit('navBackTo')
   import { onMounted, ref ,watch} from 'vue'
   function navBackTo(){
      uni.navigateBack()
   }
   const props = defineProps({
      title:{
@@ -17,7 +16,12 @@
         default:''
      }
   })
   const title = ref(props.title)
   const pageTitle = ref(props.title)
   watch(props.title,(New, Old)=>{
         pageTitle.value = New
      },
      {immediate: true},
   )
</script>
<style lang="scss">
@@ -27,19 +31,24 @@
      background: linear-gradient(to bottom,#5EA1FA,#8BC1FC);
      display: flex;
      align-items: flex-end;
      padding-bottom:24rpx;
      box-sizing: border-box;
      position: relative;
      padding:0 32rpx 24rpx;
      image{
         width:20rpx;
         width:40rpx;
         height:40rpx;
         margin-left:32rpx;
         transform: rotate(180deg);
      }
      text{
         font-weight: 400;
         font-size: 36rpx;
         color: #000000;
         margin-left: 234rpx;
         position:absolute;
         width:200rpx;
         left:calc(50% - 100rpx);
         text-align: center;
         color: #e4ecf9;
         letter-spacing:1rpx;
      }
   }
</style>