STUkh/vue-promise-btn

The promise provided in extended mode does not accept arrays

threedot14 opened this issue · 3 comments

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
The promise reference in extended mode does not accept an array expression.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
https://codesandbox.io/s/2v22232nx0

What is the expected behavior?
I would like to have an array reference in the promise reference.

Which versions of Vue and VuePromiseBtn, and which browser / OS are affected by this issue?
I am using Vue 2.6.8, vue-promise-btn 2.0.2.
The code sandbox has 2.6.10, doesn't make a difference.
On Windows 7, using Chrome 72.0.3626.121

STUkh commented

@threedot14 Hey! I looked into your problem and seems that problem not in plugin, but in logic itself:
All properties in data become reactive, so alternate array reactive itself, but not it's children. Because of this alternate[0] and alternate[1] are NOT reactive values. To make this works - just try to transform array children to reactive values (with Vue.set method). The easiest way to fix your example what i see - use Object instead of Array: https://codesandbox.io/s/6yk4mq9jnk
Hope it helps, free to close issue if yes.

@STUkh You are right of course. Forgot about the array reactivity gotcha Sorry for the bother

STUkh commented

@threedot14, you're welcome. Thanks for pretty-described case.