You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<script setup lang='ts'>
import { ref } from'vue';/** * Implement a composable function that toggles the state * Make the function work correctly*/function useToggle(initialState:boolean) {const state =ref<Boolean>(initialState??false);const toggle =function() { state.value=!state.value };return [ state, toggle ]}const [state, toggle] =useToggle(true)
</script>
<template>
<p>State: {{ state ? 'ON' : 'OFF' }}</p>
<button@click="toggle">
Toggle state
</button>
</template>
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: