Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access data and method in devtools with Vue 3 and script setup

I wrote a component like this one:

<template>
 <div>{{ myData }}</div>
</template>

<script setup>
const myData = ref('')
const myFunction = () => {
  console.log('test function')
}
</script>

In the devtools console, how to access myData or myFunction with $vm?

like image 278
ManUtopiK Avatar asked Sep 15 '26 17:09

ManUtopiK


1 Answers

By dint of searching, I found!

$vm.setupState expose data and methods.

like image 79
ManUtopiK Avatar answered Sep 20 '26 23:09

ManUtopiK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!