zoukankan      html  css  js  c++  java
  • vue基础

    <!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>资料</title>
        <style type="text/css">
            [v-cloak] {
                display: none;
            }
        </style>
    </head>

    <body>
        <div>练习</div>
        <div id="app">
            <div v-cloak>{{msg}}</div>
            <div v-cloak>{{num}}</div>
            <div v-text='mkg'></div>
            <div v-html='mag'></div>
            <div v-once>{{mlk}}</div>
            <div v-pre>{{eee}}</div>
            <div>{{model}}</div>
            <div>
                <input type="text" v-model='model'>
            </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 src="https://unpkg.com/vue/dist/vue.js"></script>
        <script type="text/javascript">
            var vm = new Vue({
                el: "#app",
                data: {
                    msg: 'hello world!',
                    num: 0,
                    mag: '<h1>hello vue!<h1>',
                    mkg: 'hello java!',
                    mlk: 123,
                    eee: 456,
                    model: 'model'

                },
                methods: {
                    handle: function (){
                        console.log(this === vm)
                        this.num++;
                    }
                }
            })

        </script>

    </body>

    </html>
  • 相关阅读:
    gitblit安装使用
    谷歌AMP和百度MIP是什么鬼?
    微信小程序开发体验
    设计模式之策略模式
    【前端安全】JavaScript防XSS攻击
    【前端安全】JavaScript防流量劫持
    设计模式之“中间件模式”
    设计模式之Mixin模式
    设计模式之观察者模式
    设计模式之单例模式
  • 原文地址:https://www.cnblogs.com/jiaoliuxuexi/p/15083462.html
Copyright © 2011-2022 走看看