vue.js - 使用 Vue.js 组合 API 的全局反应状态
问题描述
使用像 vuex 这样的 vue-composition API 的最佳解决方案是什么?
import { reactive, readonly } from "vue";
const state = reactive({
count: 0
});
const increment = function () {
state.count++;
}
export default { state: readonly(state), increment };
解决方案
推荐阅读
- android - AWS Pinpoint - Amplify - Android - 自定义事件记录在控制台中,但无法通过它们进行过滤
- vb.net - 如何将localdb连接到水晶报表
- c# - 使用 EF Core 和 C# 使用 PgSql 进行 Sql 参数化
- java - 在容器周围移动标签时出现 JavaFX 异常。(IndexOutOfBoundsException)
- python - 从 Python 的 fortran 获取两个值?
- python - 在python中使用table_id和beautifulsoup来提取数据
- reactjs - 如何在不渲染子组件的情况下处理删除按钮
- python - Tensorflow 错误:'RepeatedCompositeFieldContainer' 对象没有属性 'append'
- r - ggplot2:如何在角度为 0 度的圆形 360 度条形图中显示数据点?
- php - PHP:: 完全限定方法文字到字符串