vue-termui
vue-termui copied to clipboard
`v-if` does't work correctly
code
<script lang="ts" setup>
const whatShow = ref('Bar')
onKeyData(['k'],() => {
whatShow.value = whatShow.value === 'Foo' ? 'Bar' : 'Foo'
console.log('value changed:',whatShow.value)
})
</script>
<template>
<Box>
<Text color="red" v-if="whatShow === 'Foo'">Foo</Text>
<Text color="green" v-else>Bar</Text>
</Box>
</template>
Steps:
- Open Reproduction
- Press
K
- Watch console, the value
whatShow
has changed but template render is not correct.