v-if on a DIV but always display its contents with Vue.js?

后端 未结 3 1150
[愿得一人]
[愿得一人] 2021-02-20 14:15

With Vue.js I need to toggle a parent-div, but always show the child-div.

3条回答
  •  自闭症患者
    2021-02-20 14:38

    I made the following component. It doesn't seem perfect as it requires to also define parent of the potential wrapper element and both types and properties are passed as 'props' instead of using pure HTML, but it should work.

    
    
    
    

    Usage example below.

    
      WRAPPED
    
    

提交回复
热议问题