解説

Sample

<!DOCTYPE html>
<html lang="ja">
<head>
    <script src="<https://unpkg.com/[email protected]>"></script>
</head>
<body>
    <div id="app">
        <ol>
            <li v-for="(color, index) in colors">{{ index }}{{ color }}</li>
						🔼この様にindexも参照できる
        </ol>
    </div>

    <script>
        const app = Vue.createApp({
            data: () => ({
                colors: ['Red', 'Greed', 'Blue']
            })
        })
        app.mount('#app')

    </script>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
    <script src="<https://unpkg.com/[email protected]>"></script>
</head>
<body>
    <div id="app">
        <p>Value</p>
        <ul>
            <li v-for="value in user">{{ value }}</li>
        </ul>

        <p>key:value</p>
        <ul>
            <li v-for="(value, key, index) in user">{{ key }} : {{ value }}</li>
						🔼この様にkeyとindexが参照できる

        </ul>
    </div>

    <script>
        const app = Vue.createApp({
            data: () => ({
                user: {
                    lastName: 'Miura',
                    firstName: 'Issei',
                    age: 28
                }
            })
        })
        app.mount('#app')

    </script>
</body>
</html>
<template v-for="fruit in fruits">
	<li>{{ fruit }}</li>
	🔼templateタグで括ると配下の要素で使用ができる
	<hr>
</template>
<ul>
	<li v-for="n in 10">{{ n }}</li>
</ul>