ws456999 / vue-typescript-starter

vue-typescript-starter 脚手架
327 stars 95 forks source link

Binding element 'commit' implicitly has an 'any' type. #10

Closed RicoLiu closed 6 years ago

RicoLiu commented 6 years ago

Hi, 我在学习 vuex + typescript 的时候遇到了一个问题,代码如下:

// actions
const actions = {
  increment: ({ commit }) => commit('increment'),
  decrement: ({ commit }) => commit('decrement'),
  incrementIfOdd({ commit }) {
    if ((state.count + 1) % 2 === 0) {
      commit('increment');
    }
  },
  incrementAsync({ commit }) {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        commit('increment');
        resolve();
      }, 1000);
    });
  },
};

结果报了这个错: wx20180831-115011

请问该如何修复?

ws456999 commented 6 years ago

@RicoLiu ,请问有最小实现吗

RicoLiu commented 6 years ago

@ws456999 你是说依赖的版本?

ws456999 commented 6 years ago

@RicoLiu 有重现repo么

RicoLiu commented 6 years ago

@ws456999 已经修复了