vue icon indicating copy to clipboard operation
vue copied to clipboard

empty slot does not render as default if there is v-if as evaluated false more than 1

Open KSH-code opened this issue 3 years ago • 7 comments

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.

KSH-code avatar Jan 07 '21 10:01 KSH-code

I'm going to fix soon.

KSH-code avatar Jan 07 '21 10:01 KSH-code

~~As a workaround,~~ The proper code should use v-else-if

posva avatar Jan 07 '21 10:01 posva

Thank you for proposal! By the way, people could mistake using v-if more than once instead of using v-else-if.

KSH-code avatar Jan 07 '21 11:01 KSH-code

@andacistan No, I want to actually use slot using shorthand. :) It does not need to name id

KSH-code avatar Feb 28 '21 15:02 KSH-code

@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.

KSH-code avatar Nov 30 '21 09:11 KSH-code

Is there any optimization to this? Because it seems to me the same

mingtianshi avatar Dec 01 '21 03:12 mingtianshi

@mingtianshi It may be applied in 2.6.15, because of plan from https://github.com/vuejs/vue/pull/11857.

KSH-code avatar Dec 01 '21 06:12 KSH-code

I close this Issue, because it is not maintained

KSH-code avatar Oct 31 '22 03:10 KSH-code