为什么总是包含“v-else”模板块?

时间:2017-12-08 08:07:40

标签: vuejs2

我有两个组件模板和一个标志。

1234

但默认包含第二个模板。为什么呢?

1 个答案:

答案 0 :(得分:1)

首先,在创建vuejs时,每个组件只允许一个根元素,所以没有v-else部分你的组件将无法工作,除非你将模板更改为div,并创建一个父模板:

如果您不想使用for a fixed english word e_x in all sentences: for all foreign word f_y in the sentence where f_y and e_x appears together: Z += apply the count in <.. I have the function for calculating this..> ,可以使用v-if作为:

v-show

但这不适用于模板。因为vuejs组件中不能有两个模板