Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIcon "icon" not updating content #41

Open
igoohd opened this issue Feb 28, 2024 · 0 comments
Open

CIcon "icon" not updating content #41

igoohd opened this issue Feb 28, 2024 · 0 comments

Comments

@igoohd
Copy link

igoohd commented Feb 28, 2024

In my nuxt app when I have a case that I want to change the icon according to a ref, but, even if the prop of CIcon (icon) is changing it doesn't update the content and re-render CIcon with the new value.

<template>
  <span class="tw-ml-2 tw-self-center">
    <CIcon
      :icon="currentIcon"
      size="xl"
      class="tw-cursor-pointer !tw-text-gray-500 tw-select-none"
      @click="togglePasswordVisibility"
    />
  </span>
</template>

<script lang="ts" setup>
const emit = defineEmits(['toggleInputType'])

const isHidden = ref(true)

const currentIcon = computed(() => {
  return isHidden.value ? cilLockLocked : cilLockUnlocked
})

const togglePasswordVisibility = () => {
  isHidden.value = !isHidden.value
  emit('toggleInputType')
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant