• vue--04


    <!DOCTYPE html>
    <html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <style type="text/css">
        [v-cloak] {
            display: none;
        }
    </style>

    <body>
        <div id="app">
            <div v-cloak>{{msg}}</div>
            <div>{{1 + 9}}</div>
            <div>{{msg + '---' + 123}}</div>
            <div v-html='mag'></div>
            <div v-pre>{{mag}}</div>
            <div v-text>{{msg}}</div>
            <div v-once>{{info}}</div>
            <div>{{mhg}}</div>
            <div>
                <input type="text" v-model="mhg">
            </div>
            <div>{{num}}</div>
            <div>
                <button v-on:click='num++'>点击01</button>
                <button @click='num++'>点击02</button>
                <button @click='handle'>点击03</button>
                <button @click='handle()'>点击04</button>
            </div>
        </div>
        <script type="text/javascript" src="js/vue.js"></script>
        <script type="text/javascript">

            var vm = new Vue({
                el: '#app',
                data: {
                    msg: 'hello!',
                    mag: '<h1>hello vue<h1>',
                    info: 'python',
                    mhg: 'java',
                    num : 0
                },

                methods: {
                    handle: function() {
                        console.log(this === vm)
                        // 这里的this是Vue的实例对象+
                        //   在函数中 想要使用data里面的数据 一定要加this 

                        this.num++;
                    }
                }
            })

        </script>

    </body>

    </html>
  • 相关阅读:
    phontomjs debug with webkit inspector
    《Node Web开发》((美)David Herron)【摘要 书评 试读】 京东图书
    PhantomJS in nonheadless mode Google Groups
    Backbone.js
    Underscore.js
    Free HTTP Sniffer: a free HTTP packet sniffer to find the URLs.
    phantomjs node.js parse child process output line by line (spawn) Stack Overflow
    Getting Started · jashkenas/rubyprocessing Wiki
    使用 JSONP 实现跨域通信,第 2 部分: 使用 JSONP、jQuery 和 Yahoo! 查询语言构建 mashup
    JavaScript中的正则表达式
  • 原文地址:https://www.cnblogs.com/jiaoliuxuexi/p/15089019.html
Copyright © 2020-2023  润新知