首页 > 其他 > 详细

vue基础

时间:2021-07-31 11:15:05      阅读:17      评论:0      收藏:0      [点我收藏+]
<!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>

vue基础

原文:https://www.cnblogs.com/jiaoliuxuexi/p/15083462.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!