I have implemented the code below in a page.
<script>
export default {
name: 'FaqSection',
props: {
content: {
type: Object,
required: true,
},
},
data() {
return {
scrollArgs: {
behavior: 'smooth', block: 'start', inline: 'nearest',
},
};
},
methods: {
scroll(name) {
const collapseElement = document.querySelector(name);
const collapseElementPosition = collapseElement.getBoundingClientRect();
const windowHeight = document.documentElement.clientHeight;
if (collapseElementPosition.bottom > windowHeight) {
collapseElement.scrollIntoView(this.scrollArgs);
}
},
},
};
</script>
What is the process of updating it from Vue's Options API to the Composition API <script setup lang="ts">