欢迎光临
我们一直在努力

vue的activated在子组件中如何使用

本篇内容主要讲解“vue的activated在子组件中如何使用”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“vue的activated在子组件中如何使用”吧!

页面:base:

<template>
  <div class="tab-container">
    <h2 >
      申请{{ form.category }}{{ form.companyType }}入驻
    </h2>
    <div class="form-panel" >
      <el-button type="info" @click="cancelSave">取消</el-button>
      <el-button type="warning" @click="transientSave">暂存</el-button>
      <el-button type="danger" @click="persistSave">保存</el-button>
    </div>
    <el-tabs v-model="activeName"  type="border-card" :before-leave="collectPaneFormData" @tab-click="initPaneData">
      <el-tab-pane v-for="item in tabMapOptions" :key="item.key" :label="item.label" :name="item.key">
        <keep-alive>
          <tab-pane :is="item.key" :ref="item.key" :type="item.key" @create="showCreatedTimes" />
          <!--<component :is="item.key" :ref="item.key" :type="item.key" @create="showCreatedTimes" />-->
        </keep-alive>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

有五个tab-pane, 其中三个子组件中有activated方法。这三个子组件中都有连接跳转到person, 当在person中进行:this.$router.go(-1)

// 取消,关闭返回
    cancelSubmit() {
      // 调用全局挂载的方法,关闭当前页
      this.$store.dispatch('tagsView/delView', this.$route)
      this.$router.go(-1)
    },

这时三个子组件的activated方法都会执行吗?如何只让跳转到person中的哪个子组件的activated方法执行,其它两个不执行activated方法

到此,相信大家对“vue的activated在子组件中如何使用”有了更深的了解,不妨来实际操作一番吧!这里是云搜网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。