【前端】VUE3使用$ref()糖語法 去除.value 用法
Reactivity Transform | Vue Macros (sxzz.moe)文章來源地址http://www.zghlxwxcb.cn/news/detail-650952.html
<script setup>
let count = $ref(0)
console.log(count)
function increment() {
count++
}
</script>
<template>
<button @click="increment">{{ count }}</button>
</template>
import { $ref } from 'unplugin-vue-macros/macros'
// 適用于獨立版本:
// import { $ref } from '@vue-macros/reactivity-transform/macros-global'
const count = $ref(0)
文章來源:http://www.zghlxwxcb.cn/news/detail-650952.html
到了這里,關(guān)于【前端】VUE3使用$ref()糖語法 去除.value的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!