vue-termui icon indicating copy to clipboard operation
vue-termui copied to clipboard

`v-if` does't work correctly

Open yuyinws opened this issue 2 years ago • 0 comments

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:

  1. Open Reproduction
  2. Press K
  3. Watch console, the value whatShow has changed but template render is not correct.

yuyinws avatar Sep 07 '22 01:09 yuyinws