vue
vue copied to clipboard
empty slot does not render as default if there is v-if as evaluated false more than 1
Version
2.6.11
Reproduction link
https://codepen.io/ksh-code/pen/wvzXmEB
Steps to reproduce
click update button multiple times then value'll be set 0.
What is expected?
if value 0, then render "no data".
What is actually happening?
empty component as comment created.
I'm going to fix soon.
~~As a workaround,~~ The proper code should use v-else-if
Thank you for proposal! By the way, people could mistake using v-if more than once instead of using v-else-if.
@andacistan No, I want to actually use slot using shorthand. :) It does not need to name id
@posva
I think this is kind of bugs, because normal programming languages support if
statement like else if
.
e.g.
if a == 1
process for a
end
if b == 1
process for b
end
is the same as
if a == 1; process for a
else if b === 1; process for b
Though I'm not a newbie in CS, but newbies can do with multiple if
statement.
Is there any optimization to this? Because it seems to me the same
@mingtianshi It may be applied in 2.6.15, because of plan from https://github.com/vuejs/vue/pull/11857.
I close this Issue, because it is not maintained