Houjie
2025-07-24 964faa1077a89713910063c39ebe08fac4e4c56e
pages/index/index.vue
@@ -42,10 +42,20 @@
            ++this.commponent3Key
      },
      methods: {
         NavChange: function(e) {
            this.PageCur = e.currentTarget.dataset.cur
         NavChange(e) {
           const cur = e.currentTarget.dataset.cur
           // 如果切换到首页,手动更新 cur 值,触发 watch
           if (cur === 'home') {
             // 假设 home 组件已挂载,可通过 ref 调用方法或更新 prop
             this.$refs.home && this.$refs.home.$emit('update:cur', 'home')
           }
           this.PageCur = cur
         }
         // NavChange: function(e) {
         //    this.PageCur = e.currentTarget.dataset.cur
         // }
      }
   }
</script>