Skip to content

Vue Integration

Twoslash Vue is a Twoslash integration that added support for Twoslash to handle Vue Single File Component files.

This is an example taken from the Twoslash Vue documentation website.

```vue twoslash
<script setup>
import { onMounted, ref } from 'vue'
// ^?
// Reactive state.
const count = ref(0)
// Functions that mutate state and trigger updates.
function increment() {
count.value++
}
// Lifecycle hooks.
onMounted(() => {
console.log(`The initial count is ${count.value}.`)
})
</script>
<template>
<button @click="increment">
Count is: {{ count }}
</button>
</template>
```