Optional parent element in Vue.js

前端 未结 3 1286
走了就别回头了
走了就别回头了 2020-12-17 21:26

Is there any way to define the parent element as optional based on a condition but always show its children in Vue.js?

For example:



        
3条回答
  •  醉酒成梦
    2020-12-17 22:16

    You could use a combination of custom components and named slots to alleviate duplication of children, for example:

    
        
            
        
        

    Or if the content you want to change is not too complex maybe you could look into using v-html

提交回复
热议问题