2
 Vuex.Store({
  state: {
    percentage: 0,
  },
...

I want to do <progress max="100" v-model="percentage"></progress> but I'm getting error 'v-model' directives aren't supported on <progress> elements. How to do it otherwise?

I would like to render it as such (or similar)

<progress max="100" value="0"></progress>
naglas
  • 462
  • 1
  • 6
  • 16

1 Answers1

1

Add this to the parent of the progress component;

import { mapState } from "vuex";
computed: {
               ...mapState({
                    percentage: state => state.percentage,
               }),
}

This will get the updated values from the store. Then, bind it to the value of the component:

<progress max="100" :value="percentage"></progress>
Majed Badawi
  • 27,616
  • 4
  • 25
  • 48