XiaoLin1995/vue-fortune-wheel

Can't have weight working

Closed this issue · 2 comments

Hi there,

Thank you so much for the weight addon, I'm trying to have it working and I'm unable to do it.

I have version "vue-fortune-wheel": "^0.3.4".

My FortuneWheel looks like:

<FortuneWheel
  v-if="showWheel"
  style="width: 100%"
  borderColor="#584b43"
  :borderWidth="1"
  :textLength="3"
  :useWeight="true"
  :fontSize="fontSize"
  :textRadius="230"
  :prizes="prizes"
  @rotateStart="onCanvasRotateStart"
  @rotateEnd="onRotateEnd"
/>

And I have weight property defined in every prize.

When I enter the wheel, I get this warning:
[Vue warn]: Error in created hook: "TypeError: Cannot read property 'toString' of undefined"

And it goes away when I insert probabilities in every prize, then I have it working but it's using probabilities and not weights.

Thanks!

Sorry, I did not have this problem here, but a version was updated today, you can try to update.
And are you sure that the value of each prize is correct?

It's working now with version 1.0.0.

Thanks!