How to use v-if and v-else without any html tag or else

后端 未结 2 645
生来不讨喜
生来不讨喜 2020-12-16 09:47

List item

  • language
  • < v-if= \"tree()\"> //which tag I may use or any other process
  • home
相关标签:
2条回答
  • 2020-12-16 10:07

    You can use template:

    <template v-if="condition">
    </template>
    <template v-else>
    </template>
    

    Template will not be rendered in the browser. But it will parse the contents inside of this to the html.

    0 讨论(0)
  • 2020-12-16 10:26

    you can sometimes use the <slot> element to make what you want. Have a look at the slot documentation here

    0 讨论(0)
提交回复
热议问题