美文网首页
路由params跳转并在跳转后的页面默认打开el-tree

路由params跳转并在跳转后的页面默认打开el-tree

作者: Hello杨先生 | 来源:发表于2019-12-21 10:58 被阅读0次
           {path: 'know/knowledgeArticle/:routerKnowledgeid',name:'knowledgeArticle',component: () => import('../view/know/knowledgeArticle'), meta: {title: '通行宝EAAS客服运营平台', des: '文章',funCode:'m9-1'}},
    
    
    routerKnowledgeid:[],  //到article页面的唯一标识
    
    console.log('路由带参knowledgeid获取的参数routerKnowledgeid',this.$route.params.routerKnowledgeid)
    this.routerKnowledgeid.splice(0,this.routerKnowledgeid.length)
    this.routerKnowledgeid.push(this.$route.params.routerKnowledgeid)
    
            this.routerKnowledgeid.splice(0,this.routerKnowledgeid.length)
            if (!!data.knowledgeid)  {
              this.routerKnowledgeid.push(data.routerKnowledgeid)
              this.$router.push({name:'knowledgeArticle',params:{label:data.routerKnowledgeid}})
            }
    
     this.$router.push({name:'knowledgeArticle',params:{routerKnowledgeid: .knowledgeid}})
    
    
              <el-tree
                accordion
                :data="parent"
                highlight-current
                @node-click="handleNodeClick"
                node-key="knowledgeid"
                :default-expanded-keys="routerKnowledgeid"
                :default-checked-keys="routerKnowledgeid"
              >
                <!--            node-key="label"-->
                <!--            :default-expanded-keys="label"-->
                <!--            :default-checked-keys="label"-->
                <span  slot-scope="{ node, data }" style="font-size:14px;font-weight:500;color:#444444;">
                    <span style="display:inline-block;width:150px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" >
    <!--                  {{ node.label }}{{node.created}}-->
                      {{ node.label }}
                    </span>
                  </span>
              </el-tree>
    
    

    相关文章

      网友评论

          本文标题:路由params跳转并在跳转后的页面默认打开el-tree

          本文链接:https://www.haomeiwen.com/subject/altgnctx.html