Fix convertion to Composition API for Avatar component (#1391)
* Fix Convertion for Avatar component * Use ref for img
This commit is contained in:
parent
a6766ef1c0
commit
fcfa508cbc
@ -36,6 +36,7 @@
|
||||
|
||||
<script setup>
|
||||
const pixelated = ref(false)
|
||||
const img = ref(null)
|
||||
|
||||
defineProps({
|
||||
src: {
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user