Vue JS保持标签组件保持活动状态

huangapple go评论59阅读模式
英文:

Vue JS keep tab component alive

问题

抱歉,以下是您要翻译的内容:

All,

I need some help making keepAlive in VueJS3 composition api work.

I have a page to configure profiles ( business feature ) where I have some tabs created dynamicly based on user selection from a drop down.

Here is my profile model :

Vue JS保持标签组件保持活动状态

So Each tab is an entry to the realm attribute array.

Vue JS保持标签组件保持活动状态

The VTAB component I am using is from vuero library : https://vuero.cssninja.io/

That I am using this way :

Vue JS保持标签组件保持活动状态

While making modifications, the user should be able to switch tabs without losing the modification he made while switching tabs.

From official documentation, keepalive is the directive to be used for such use case. Unfortunatly I am not able to make it work. I lose all the modifications when I switch the tab.

Do you have any suggestions, to make this work .

Thanks A lot.

英文:

All,

I need some help making keepAlive in VueJS3 composition api work.

I have a page to configure profiles ( business feature ) where I have some tabs created dynamicly based on user selection from a drop down.

Here is my profile model :

Vue JS保持标签组件保持活动状态

So Each tab is an entry to the realm attribute array.

Vue JS保持标签组件保持活动状态

The VTAB component I am using is from vuero library : https://vuero.cssninja.io/

That I am using this way :

Vue JS保持标签组件保持活动状态

While making modifications, the user should be able to switch tabs without losing the modification he made while switching tabs.

From official documentation, keepalive is the directive to be used for such use case. Unfortunatly I am not able to make it work. I lose all the modifications when I switch the tab.

Do you have any suggestions, to make this work .

Thanks A lot.

答案1

得分: 0

这似乎是 vuero 组件的限制。我采用了一个自定义解决方案,通过监听 onBeforeUnmount 事件。

英文:

It seems to be a limitation from vuero component.
I went with a cutsom solution. By listening on the onBeforeUnmont

Vue JS保持标签组件保持活动状态

huangapple
  • 本文由 发表于 2023年2月8日 22:15:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75387054.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定