Having some trouble with scrolling to a specific element when clicked. I keep getting this error message.
Uncaught TypeError: element.scrollIntoView is not a function
Here is my script
<script setup>
import { ref } from 'vue'
function goTo(refName){
let element = ref(refName);
element.scrollIntoView({behavior: "smooth"})
}
</script>
This is the click function
<DayWithText v-for="day in daysOfWeek" :name="day.shortHand" :day="day.day" :date="day.date" @click.prevent="goTo('test')"/>
And here is the element causing issues
<p ref="test">test</p>
Any ideas on what might be going wrong?