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

发布时间:2022-04-16 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了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方法

到此这篇关于vue activated在子组件中的使用详情的文章就介绍到这了,更多相关vue activated在子组件中的使用内容请搜索脚本宝典以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本宝典!

脚本宝典总结

以上是脚本宝典为你收集整理的vue activated在子组件中的使用详情全部内容,希望文章能够帮你解决vue activated在子组件中的使用详情所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:vue