Liuyi
2024-10-07 134c7e51d33dfd0cdb9e7d47b22d181ebc1bcdc8
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/addCard/back.png" 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">