Introduce a compiler-based syntax sugar for using refs without .value:
<script setup>
// declaring a variable that compiles to a ref
let count = $ref(1)
console.log(count) // 1
function inc() {
// the variable can be used like a plain value
count++
}
</script>
<template>
<button @click="inc">{{ count }}</button>
</template>
Summary
Introduce a compiler-based syntax sugar for using refs without
.value
: