You've already forked AstralRinth
forked from didirus/AstralRinth
Fix convertion to Composition API for Avatar component (#1391)
* Fix Convertion for Avatar component * Use ref for img
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
const pixelated = ref(false)
|
const pixelated = ref(false)
|
||||||
|
const img = ref(null)
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
src: {
|
src: {
|
||||||
@@ -72,10 +73,10 @@ defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function updatePixelated() {
|
function updatePixelated() {
|
||||||
if (this.$refs.img && this.$refs.img.naturalWidth && this.$refs.img.naturalWidth <= 96) {
|
if (img.value && img.value.naturalWidth && img.value.naturalWidth <= 96) {
|
||||||
this.pixelated = true
|
pixelated.value = true
|
||||||
} else {
|
} else {
|
||||||
this.pixelated = false
|
pixelated.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user