Replies: 1 comment
-
Consider the example: <script setup>
import { ref } from 'vue'
if (false)
return
const msg = ref('Hello World!')
</script>
<template>
<h1>{{ msg }}</h1>
<input v-model="msg">
</template> The |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What problem does this feature solve?
I want to use "return" or (or something different) to stop a script setup code from running.
In the example, the functions should only run if the dynamic list is bigger than 0.
I understand I can invert the ifs, but imagine if we didn't import these functions, but instead, you had to write the code directly. Suddenly you need your whole component's code wrapped around an if when all you can do is prevent the code from running under a specific condition.
What does the proposed API look like?
Beta Was this translation helpful? Give feedback.
All reactions