<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="" />
<script src="v.js"></script>
</head>
<style> </style>
<body>
<div id="root"></div>
</body>
<script>
function l(e) {
console.log(e)
}
const app = Vue.createApp({
data(){
return {
num:100,
num2:100
}
},
methods:{ },
template:`
<div> <counter v-model:count="num" v-model:app="num2" />
</div> `
}) app.component('counter',{
props:['count','app'],
methods:{
handleClick(){
this.$emit('update:count',this.count+3)
},
handleClick2(){
this.$emit('update:app',this.app+30)
}
},
template:`<div @click="handleClick">{{count}}</div>
<div @click="handleClick2">{{app}}</div>
`
}) const vm = app.mount("#root")
</script>
</html>

vvvvvvue的更多相关文章

随机推荐

  1. Note Taking App Comparison: Notesnook vs Joplin

    I have used many note-taking apps, including Notion, oneNotes, Obsidian, Sublime Text, etc. Here I w ...

  2. LinkedList的线程安全解决办法

    方法一:List<String> list = Collections.synchronizedList(new LinkedList<String>()); 方法二:将Lin ...

  3. 新的学习历程-python6 字符串基础使用

    1 sentence1 = 'tom\'s pet is a cat' # 单引号中包含转单引号 2 sentence2 = "tom\'s pet is a cat" 3 sen ...

  4. rtl8188eu 关闭power save

    RTL8188eu 关闭power saving 当PC端没有和设备交换数据时,rtl8188eu会进入节能模式,很影响调试开发. 关闭方法:找到驱动代码include/autoconf.h 发现要禁 ...

  5. having对聚合函数的结果集进行过滤

    SELECT rl.road_code,string_agg(distinct rs.tech_level_label, ',') from road_lst rlleft join road_sec ...

  6. 容器之docker基础

    一 docker的介绍 Docker是一个开源的应用容器引擎,使用Go语言开发,基于Linux内核的cgroup, namespace, Union FS等技术,对应用进程进行封装隔离,并且独立于宿主 ...

  7. Android集成并开启手写笔识别

    1.首先,需要下载Pdf xchange View SDK,然后将其集成到Android项目中: 2.在Android项目中,添加以下依赖: implementation 'com.github.PD ...

  8. C# 委托/回调

    public delegate void MyDelegate();//定义一个委托类型 MyDelegate myDelegate;//创建一个委托变量 myDelegate = new MyDel ...

  9. Apache和Nginx设置伪静态(URL Rewrite)的方法

    在Apache中有两种方法配置,一是通过httpd.conf文件,二是通过.htaccess文件. 使用 httpd.conf 来配置 rewrite 策略. 要使用 httpd.conf 文件来设置 ...

  10. redis的windows下安装

    转载https://www.runoob.com/redis/redis-install.html Redis 安装 Windows 下安装 下载地址:https://github.com/tpora ...