事件处理,js会了点,vue好像又不会了,vue怎么好像搞得比js在事件处理上更复杂?

news/2024/7/19 16:20:53 标签: vue, js

这段代码怎样用vue实现?

<html>
    <head>   
        <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
        <script type="text/javascript"> 
        
            function display_alert() 
            { 
                alert('hamimelon!')   
            }
    </script>
    </head>
    <body>
        <input type="button" onclick = "display_alert()" value="wo shi yige " />
    </body>
</html>


http://www.niftyadmin.cn/n/957895.html

相关文章

springcloud dashboard控制面板上的各项指标详解(图文并茂)

所有的开始-pom.xml 引入依赖&#xff0c;所有的代码的第一步就是引入依赖&#xff0c;这里因为之前的项目针对MQ这块的优化引入了springcloud-stream这个依赖&#xff0c;而这个依赖又包含了dashboard&#xff0c;所以这里不需要再引入spring-boot-starter-actuator springbo…

微信小程序合并两个对象

var tmpa {q : qq,w : ww}var tmpb {e : ee,r : rr}var tmp Object.assign(tmpa , tmpb)console.log(tmp)

Java代码中,如何监控Mysql的binlog?

前言 最近在工作中&#xff0c;遇到了这样一个业务场景&#xff0c;我们需要关注一个业务系统数据库中某几张表的数据&#xff0c;当数据发生新增或修改时&#xff0c;将它同步到另一个业务系统数据库中的表中。 一提到数据库的同步&#xff0c;估计大家第一时间想到的就是基…

微信小程序父组件调用子组件的方法

1.设置组件一id <canvas-drag id"canvas"></canvas-drag>2.通过this.selectComponent(“#canvas”)获取组件对象 /*** 生命周期函数--监听页面初次渲染完成*/onReady() {this.canvas this.selectComponent("#canvas");},3.在方法中调用 thi…

全链路追踪spring-cloud-sleuth-zipkin

微服务架构下 多个服务之间相互调用&#xff0c;在解决问题的时候&#xff0c;请求链路的追踪是十分有必要的&#xff0c;鉴于项目中采用的spring cloud架构&#xff0c;所以为了方便使用&#xff0c;便于接入等 项目中采用了spring cloud sleuth zipkin 。现总结如下&#x…

MYBATIS多层嵌套查询

基于权限管理时的用户角色权限处理。 实体类&#xff1a; 1.User public class User{private Integer uid;private String username;private String password;private Set<Role> rolesnew HashSet<>();2.Role public class Role {private Integer rid;private Str…

vue的点击事件,如何添加vue的click

第一步 在html文件中填div元素&#xff0c;中间添加按钮信息 <html><div><input type"button" value"hamimelon!" /></div></html>第二步 考虑关联点击事件 第一次思考&#xff1a; 添加 <html><div><inpu…