vue3.x 之 reactive
<template>
<div>
{{ count.value }}
<button @click.prevent="Add">Add</button>
</div>
</template>
<script lang="ts">
import { defineComponent, reactive } from 'vue';
export default defineComponent({
name: 'VueTest',
setup() {
const count = reactive({ value: 0 });
function Add() {
count.value += 1
}
return {
count,
Add
};
}
});
</script>
注:reactive 接收是一個object物件
相關文章
- "Principles of Reactive Programming" 之<Actors are Distributed> (3)React
- "Principles of Reactive Programming" 之<Actors are Distributed> (2)React
- "Principles of Reactive Programming" 之<Actors are Distributed> (1)React
- go reactive宣言GoReact
- [Vue] Reactive noteVueReact
- ref和reactiveReact
- vue3原始碼學習之reactive實現Vue原始碼React
- Vue3.x全家桶+vite+TS-搭建Vue3.x專案VueVite
- Vue3響應式系統api 之 ref reactiveVueAPIReact
- "Principles of Reactive Programming" 之 <Persistent Actor State>學習筆記React筆記
- Reactive宣言的思考React
- Reactive Extensions介紹React
- petite-vue原始碼剖析-逐行解讀@vue/reactivity之reactiveVue原始碼React
- 理解Angular的Reactive FormAngularReactORM
- "reactive programming"的概念React
- Rx (Reactive Extensions)介紹React
- Hibernate Reactive 簡介React
- reactive streams與觀察者模式React模式
- 使用Akka實現Reactive DDDReact
- [Reactive] Run functions when data changesReactFunction
- vue3.x從打包、部署到上線Vue
- vue3.x頁面功能拆分方式Vue
- 使用 JavaFX 構建 Reactive 系統JavaReact
- vue3.x路由404通配處理Vue路由
- Reactive Spring實戰 -- WebFlux使用教程ReactSpringWebUX
- Spring WebFlux和Reactive程式設計SpringWebUXReact程式設計
- Hibernate引入響應性Reactive支援React
- # vue3 ref 和 reactive 函式VueReact函式
- RAC(Reactive Cocoa)常見的類React
- Vue 中ref()與 reactive() 的區別VueReact
- petite-vue原始碼剖析-逐行解讀@vue-reactivity之Map和Set的reactiveVue原始碼React
- Reactive設計語言與正規化React
- Vue3.x專案開發常用知識點Vue
- Angular Reactive Form 的一個具體使用例子AngularReactORM
- MVVM+Reactive Cocoa專案完整例項MVVMReact
- Reactive Cocoa 3.0 在 MVVM 中的應用ReactMVVM
- 使用Java和Reactive Streams構建流式應用JavaReact
- 該不該使用Reactive程式設計?先預覽一下Loom專案中的Reactive模型和協程 - frankelReact程式設計OOM模型