如何为element ui的el-tab-pane组件增加自定义事件?

需求:
一个抽像对象:person,多个具体对象: xxx_person. 内容页(/view)中有一个tab, 根据不同的xxx_person来显示不同的tab. 例: a_person的内容页(/view)有三个tab, b_person的内容页(/view)有四个tab.

现在:

    <el-tabs v-model="baseTabActiveName" type="card" @tab-click="handleClick" v-if="isReadyBuild">

<el-tab-pane v-for="(item,index) in corpInfoStepList"

:id="item.names"

:key="index"

:ref="item.names"

:label="item.title"

:name="item.names"

@dictArgBubble="listenDictArgEnroll"

@attaSctionBubble="listenAttaSctionEnroll"

@hook:mounted="childItpMounted(item.key)">

<!-- keeplive-->

<tab-pane :is="item.key" :ref="item.key" :type="item.key" :apply-obj.sync="localApplyInstance" :apply-id.sync="localApplyId" />

<!-- keeplive-->

</el-tab-pane>

</el-tabs>

问题:
希望通过:dictArgBubble来收集子标签组件的字典, attaSctionBubble来收集子标签组件的附件id, 以此来减少请求的次数。但发现: listenDictArgEnroll未被执行


回答:

答案:

    <el-tabs v-model="baseTabActiveName" type="card" @tab-click="handleClick" v-if="isReadyBuild">

<el-tab-pane v-for="(item,index) in corpInfoStepList"

:id="item.names"

:key="index"

:ref="item.names"

:label="item.title"

:name="item.names">

<!-- keeplive-->

<component :is="item.key"

:ref="item.key"

:type="item.key"

:apply-obj.sync="localApplyInstance"

:apply-id.sync="localApplyId"

@create="showCreatedTimes"

@dictArgBubble="listenDictArgEnroll"

@attaSctionBubble="listenAttaSctionEnroll"

@hook:mounted="childItpMounted(item.key)" />

<!-- keeplive-->

</el-tab-pane>

</el-tabs>

以上是 如何为element ui的el-tab-pane组件增加自定义事件? 的全部内容, 来源链接: utcz.com/p/933184.html

回到顶部