Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Fix convertion to Composition API for Avatar component (#1391)
Browse files Browse the repository at this point in the history
* Fix Convertion for Avatar component

* Use ref for img
  • Loading branch information
Mysterious-Dev authored Oct 2, 2023
1 parent a6766ef commit fcfa508
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/ui/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

<script setup>
const pixelated = ref(false)
const img = ref(null)
defineProps({
src: {
Expand Down Expand Up @@ -72,10 +73,10 @@ defineProps({
})
function updatePixelated() {
if (this.$refs.img && this.$refs.img.naturalWidth && this.$refs.img.naturalWidth <= 96) {
this.pixelated = true
if (img.value && img.value.naturalWidth && img.value.naturalWidth <= 96) {
pixelated.value = true
} else {
this.pixelated = false
pixelated.value = false
}
}
</script>
Expand Down

0 comments on commit fcfa508

Please sign in to comment.