import { ref, onMounted } from 'vue';
export default {
setup() {
const pins = ref([]);
const images = ref([]);
const logProjectElements = () => {
pins.value = document.querySelectorAll('.project__pin');
images.value = document.querySelectorAll('.project__image');
console.log('Project Pins:', pins.value);
console.log('Project Images:', images.value);
};
onMounted(() => {
logProjectElements();
});
return {
pins,
images,
};
},
};
data: {
projects: [ ... ]
}
<div class="project" v-for="p in projects">
<div class="project__pin">{{ p.pin }}</div>
</div>