小编Uel*_*elb的帖子

如何使用Vuex/Vue处理异步数据检索

我有一个带有共同堆栈的简单应用程序:

  • 后端服务器(Rails)
  • 前端应用程序(Vue)
  • 数据库(PG)

Vue应用程序使用Vuex存储库的操作从后端获取数据,如下所示:

// store/store.js
import Vue from 'vue';
import Vuex from 'vuex';
import * as MutationTypes from '@/store/mutation-types';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    investment: {},
  },
  mutations: {
    [MutationTypes.SET_INVESTMENT_SHOW](state, investment) {
      state.investment = investment;
    },
  },
  actions: {
    fetchInvestment({ commit }, id) {
      InvestmentsApi.get(id).then((response) => {
        commit(MutationTypes.SET_INVESTMENT_SHOW, response.data);
      });
    },
  },
  getters: {
    participation: state =>
      state.investment.included[0],
  },
});
Run Code Online (Sandbox Code Playgroud)

在我的组件的创建生命周期钩子中调用该操作,如下所示:

// components/Investment.vue

import { mapActions, mapGetters } from 'vuex';
export default {
  name: 'Investment',
  computed: …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vuex vuejs2

5
推荐指数
1
解决办法
2102
查看次数

如何打开Windev HFSQL Fic文件

我正在尝试读取未加密的FIC文件(事实上,显示数据时几乎可以读取数据)。我想将此文件转换为更方便的格式,CSV、XML、SQL 等...

当我尝试使用 Windev Express 19 打开它时,出现错误,告诉我该文件受密码保护。但如果真的有密码,文件就会被加密(我认为)。

如果有人知道可能是什么问题。或者有什么建议,我会很高兴。

database windev hyperfilesql

3
推荐指数
1
解决办法
4408
查看次数

标签 统计

database ×1

hyperfilesql ×1

javascript ×1

vue.js ×1

vuejs2 ×1

vuex ×1

windev ×1