Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

v-if | null check doesn't work for events (?) #60

Closed
Shinigami92 opened this issue Aug 13, 2021 · 3 comments
Closed

v-if | null check doesn't work for events (?) #60

Shinigami92 opened this issue Aug 13, 2021 · 3 comments
Labels
question Further information is requested

Comments

@Shinigami92
Copy link

It seems that v-if is not forwarded for event bindings 馃
But bindings like v-text works

const variable: Ref<Something | null>
const doSomething(x: Something)
button(v-if="variable", v-text="variable.text", @click="doSomething(variable)")
//-                                                                 ~~~~~~~~ cannot be null

image

@johnsoncodehk
Copy link
Owner

This is expected, see vuejs/language-tools#146.

@Shinigami92
Copy link
Author

Okay, so I need to wait on vuejs/core#1359
And just use workarounds for this at the moment, okay

Thanks for the incredible fast answer 馃殌

@johnsoncodehk johnsoncodehk added the question Further information is requested label Aug 13, 2021
@Shinigami92
Copy link
Author

Shinigami92 commented Aug 13, 2021

My workaround is now:

@click="template && openSharedComponentDialog(template.sharedPath)"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants