
<template>

  <view class="container">
    <tui-tab :tabs="tabs" scroll @change="tabChange"></tui-tab>


    <view class="content-container">
      <editTreeIfo v-if="currentName === '基本信息'" :treeId="id"></editTreeIfo>

      <treeLog v-if="currentName === '变更日志'" :logId="id" />
    </view>
  </view>

</template>
<script >

import treeLog from "./treeLog.vue";
import editTreeIfo from "./editTreeIfo.vue";
export default {
  components:{treeLog,editTreeIfo},
  name: "editTree",
  data(){
    return{
      tabs:['基本信息','变更日志',],
      currentName:'基本信息',
      id:''
    }
  },
  onLoad(options){
    this.id = options.id
    console.log( this.id )
    const pages = getCurrentPages(); // 获取当前页面栈
    // 只保留当前页面（移除所有历史页面）
    if (pages.length > 1) {
      // 小程序页面栈是数组，通过 splice 保留最后一个元素（当前页面）
      pages.splice(0, pages.length - 1);
    }
    // this.treeDetailQuery()
  },
  methods:{
    treeDetailQuery(){
      treeDetailReq(this.id).then(res=>{
        console.log(res)
      })
    },
    tabChange(i){
      console.log(i.item.name)
      this.currentName = i.item.name
    }
  }
}
</script>



<style scoped>
.content-container{
}

</style>