vue activated在子组件中的使用 vue activated在子组件中的使用详情

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

vue activated在子组件中的使用 vue activated在子组件中的使用详情

xiaofanku   2021-11-11 我要评论
想了解vue activated在子组件中的使用详情的相关内容吗,xiaofanku在本文为您仔细讲解vue activated在子组件中的使用的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:vue,activated,子组件中的使用,下面大家一起来学习吧。

页面:base:

<template>
  <div class="tab-container">
    <h1 style="text-align: center">
      申请{{ form.category }}{{ form.companyType }}入驻
    </h1>
    <div class="form-panel" style="margin-left: 20px;text-align: right;">
      <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" style="margin-top: 15px" 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方法

猜您喜欢

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们