LoginSignup
0
1

More than 3 years have passed since last update.

Vue v-for

Posted at

v-for 使いかた


        <div id="app-4">
            <ol>
                <li v-for="todo in todos">
                    {{ todo.text }}
                </li>
            </ol>
        </div>
        <script>
            var app4 = new Vue({
                el: "#app-4",
                data: {
                    todos:[
                        {text: 'Learn JavaScript'},
                        {text: 'Learn Vue'},
                        {text: 'Build something awesome'},
                    ]
                }
            })
        </script>

コンソールで app4.todos.push{text: 'New item' }) と入力すると、リストに新しいアイテムが追加される

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1