动态变量名Jekyll / Liquid

时间:2018-11-29 19:24:50

标签: jekyll liquid

我正在尝试使用一个变量作为另一个变量的名称。

  it('does something', () => {
    const dispatchSpy = jest.spyOn(store, 'dispatch')
    const wrapper = mount(Component, {
      store,
      localVue,
      mocks: {
        $router,
      },
    })
    let button = wrapper.find('button that calls doSomething')
    button.trigger('click')
    expect(dispatchSpy).toHaveBeenCalledWith('moduleA/moduleDoSomething',{data: data})
  })
})

这可能吗?如果没有,我是否可以使用其他替代方法使我实现与此变量类似的功能?


我不是要访问变量,而是要赋值,所以这不是Dynamic Variables Jekyll Liquid的副本。

0 个答案:

没有答案