vuex

    1热度

    1回答

    的状态突变Vuex方法是如下: const store = new Vuex.Store({ state: { fetching: false, board: null }, mutations: { setFething (state) { state.fetching = true }, setCurr

    0热度

    1回答

    逻辑我不知道如何组织我的Vuex商店给出以下问题。 我有一个按钮/操作数组,像100个。他们都在店里像这样的组织: buttons: [ { text: 'Button 1', doAction (store) {}, mustShow (store) { return state.variable > 10 && state.variable2

    1热度

    1回答

    我试图设置使用Vue的2.5.2和3.0.1 Vuex,我无法摆脱的唯一的应用程序是这样的警告: [Vue warn]: Error in render: "TypeError: _vm.product is undefined" 产品只是和产品,储存在刚刚创建的Vue实例后执行的下一行之后被填满Vuex状态的数组元素: vm.$store.dispatch('getProducts') 在我

    1热度

    2回答

    我VUE成分是这样的: <template> <ul class="nav nav-tabs nav-tabs-bg"> <li role="presentation"> <a :href="baseUrl+'/search/store/'+param"> Store </a> </li> </ul> </t

    0热度

    1回答

    我目前做如下: <script> export default { computed: { editingItem: { get() { return this.$store.getters['editing/editingItem']; }, set(newValue) { this.$store.commit('

    0热度

    1回答

    假设我需要对不同的API端点进行两次异步调用。第二个电话的查询参数取决于我从第一个 快速浏览收到: 第一个端点提供特定的顺序有些IDS(按排名进行排序,例如) 二端点提供了一些 “元信息” 那些IDS 端点例子: GET /端点/一个 响应格式: [ { id: 1, rating: 0.67 }, { id: 2, ratin

    0热度

    1回答

    我使用来自here和here的hackernews方法设置vuex和SSR,并且它都能正常工作。 app.js: // Expose a factory function that creates a fresh set of store, router, // app instances on each call (which is called for each SSR request)

    1热度

    1回答

    import Vue from 'vue' import Vuex from 'vuex' import Users from './modules/Users' Vue.use(Vuex) export const store = new Vuex.Store({ namespaced: true, state: { foo: false,

    -1热度

    1回答

    据我所知,在Vuex我们可以做store.subscribe,我们通过一个被称为在商店的每一个变化回调。 在我的应用程序中,我有一个有很多模块的商店,并且想要subscribe只适用于特定的模块,而不必拥有这种逻辑if (mutation.type != thisModule.type) return;。 是否可以只订阅一些模块? Could not find it in the docs。

    0热度

    1回答

    我很新Vue。我有很多输入的大型表格。我想将存储在Vuex存储中的所有数据作为类的属性。 const store = new Vuex.Store({ state: { cv: new CurriculumVitae() 我可以伊斯利更新这样的价值观: <input @input="updateValue" name="name"> ... methods: {