3.vue.js迭代處理數組

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>3迭代</title>
    <script src="js/vue.min.js"></script>
</head>
<body>
    <h3>3迭代</h3>
    <div id="array">
        <span v-for="value in array">{{value}}</span>
    </div>
    <script type="text/javascript">
        new Vue({
            el: '#array',
            data: {
                array:[1,2,3,4]
            }
        });
    </script>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章