vue.js组件

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
        <div id="app">
            <ol>
                <todo-item v-for="item in groceryList" :todo="item"></todo-item>
            </ol>
        </div>
        <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
        <script src="js/vue.component.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
            var vm = new Vue({
                el: '#app',
                data: {
                    groceryList: [
                        {text: 'xudongyang'},
                        {text: 'lengpengfei'}
                    ]
                }
            });
        </script>
    </body>
</html>
Vue.component('todo-item',{
    props: ['todo'],
    template: '<li>{{todo.text}}</li>'
});
上一篇:MongoDB—— 写操作 Core MongoDB Operations (CRUD)


下一篇:postgresql sql修改表,表字段