1👍
use two object, one for image in blob and other to URL, use URL.createObjectURL for get URL from image file:
<script setup>
import { ref } from 'vue'
const fotos = ref(null)
const fotos = ref(null)
const fotosURL = ref([])
const slide = ref(1)
function obtenerURL () {
if (fotos.value) {
fotos.value.forEach(element => {
fotosURL.value.push(URL.createObjectURL(element))
})
}
}
</script>
<q-file
v-model="fotos"
label="Seleccione los archivos"
filled
multiple
accept=".jpg, image/*"
style="max-width: 400px"
@update:model-value="obtenerURL"
/>
<q-carousel
animated
v-model="slide"
arrows
navigation
infinite
v-if="fotosURL.length>0"
>
<q-carousel-slide v-for="(img,id) in fotosURL" :key="id"
:name="id+1" :img-src="img" />
</q-carousel>
- [Vuejs]-Vuejs, How can I resolve expressions within a string got as a prop?
- [Vuejs]-Isset not working with AJAX
Source:stackexchange.com