Write For Loop in Vue.js

You can use the v-for directive to write For Loop in Vue.js

I am going to generate checkbox fields to select days with following code. I have used v-for directive to make the for loop

This is the Vue.js code with days array which will hold the days of the week

You can have the following output when you open this code in browser

If you want to show the selected days you can use the following modified code