zoukankan      html  css  js  c++  java
  • vue阻止事件

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title></title>
    <script src="vue.js" type="text/javascript" charset="utf-8"></script>
    <link href="./02.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
    <div id="vue-app03">
    <p>My name is : {{age}}</p>
    <button @click.once="add(1)">长一岁</button>
    <div id="a" v-on:mousemove="takeXY">
    {{x}} , {{y}} -
    <span v-on:mousemove="stopMoving">stopMoving</span>
    <span v-on:mousemove.stop="">stopMoving</span>
    </div>
    <a href="http://www.baidu.com" v-on:click.prevent="alert()">the new step</a>
    </div>
    <script src="event%20adj.js" type="text/javascript" charset="utf-8"></script>
    </body>
    </html>

    new Vue({
    el:"#vue-app03",
    data:{
    age:30,
    x:0,
    y:0,
    },
    methods:{
    add:function(inc){
    this.age+=inc;
    },
    takeXY:function(event){
    this.x=event.offsetX;
    this.y=event.offsetY;
    },
    stopMoving:function(event){

    /*
    阻止冒泡事件
    */
    event.stopPropagation();
    },
    alert:function(){
    alert("hello");

    }
    }
    })

  • 相关阅读:
    触发器
    累加求和存储过程
    check约束条件
    数据库的备份还原
    创建万能分页
    视图
    进销存存储过程
    函数存储过程
    数据库作业27~45
    数据库作业17~26
  • 原文地址:https://www.cnblogs.com/weixin2623670713/p/12865084.html
Copyright © 2011-2022 走看看