Logo - Open book, behind two sails with text, docs
-tech. annebrown.ca

Ref()

Ref() Function

Description

  • Used to make primitive vals reactive
  • Auto-imported

Usage

<script setup>
const count = ref(0)

function increment() {
  count.value++
}
</script>

<template>
  <button @click="increment">Count is: {{ count }}</button>
</template>