VUE.JS(2)

由于未提供博客具体内容,无法生成包含关键信息的摘要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>

    <div id="app">
        <!-- v-cloak解决闪烁 -->
        <p v-cloak>--{{ msg }}--</p>
        <!-- 
            1.v-text没有闪烁
            2.v-text会替换标签内的所有内容
         -->
        <h4 v-text="msg">--</h4>
        <p v-html="msg2"></p>
        <!-- 
            1.v-bind用于绑定属性,简写:
            2.在变量后可以加字符串
            3.v-on事件绑定机制,简写@
         -->
        <input type="button" value="input" v-bind:title="mytitle" @click="show">
        <input type="button" value="input" :title="mytitle+'——111'">
        <input type="button" value="input" @mouseover='move'>
    </div>

    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                msg: "测试,测试",
                msg2: "<h4>{{ msg2 }}</h4>",
                mytitle:"我自己的title"
            },
            methods:{
                show:function(){
                    alert('hello')
                },
                move(){
                    alert('hello')
                }
            }
        })
    </script>
</body>

</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值