// methods 的作用,就是定义事件的处理函数
methods: {
add(n) {
// 在 methods 处理函数中,this 就是 new 出来的 vm 实例对象
// console.log(vm === this)
console.log(vm)
// vm.count += 1
this.count += n
},
sub() {
// console.log('触发了 sub 处理函数')
this.count -= 1
}
}
this就是当前的vm对象
2024-05-28 09:20:06 阅读次数:44
// methods 的作用,就是定义事件的处理函数
methods: {
add(n) {
// 在 methods 处理函数中,this 就是 new 出来的 vm 实例对象
// console.log(vm === this)
console.log(vm)
// vm.count += 1
this.count += n
},
sub() {
// console.log('触发了 sub 处理函数')
this.count -= 1
}
}
this就是当前的vm对象
上一篇:有一块10000 * 10000 * 10000的立方体豆腐, 豆腐的前左下角放在(0,0,0)点,豆腐的后右上角放在(10000,10000,10000)点。
【Hadoop】YARN多资源队列配置及使用实践
基于主流SpringBoot进行JavaWeb开发的学习路线
之前使用的组件间通信使用的都是基于Vue的一些属性,方法等。本篇基于原生JS的订阅发布来实现跨组件通信。
深入理解前端路由
Vue 专属状态管理库Pinia的使用与实践
webpack 加载vue组件webpack You are using the runtime-only build of Vue where the template compiler is no
Selenium Webdriver 3.X源码分析之核心代码common
理解和选择Vue的组件风格:组合式API与选项式API详解
使用 Vue 和 Create-Vue 构建工程化前端项目
一键转换SQL为RESTful API:全栈技术实践与心得分享
文章
32777
阅读量
4864908
2025-02-21 08:55:20
2025-01-17 09:14:02
2025-01-17 09:06:45
2024-12-10 07:14:00
2024-09-25 10:14:34
2024-09-24 06:30:26
2023-03-07 10:04:03
2023-03-13 09:32:12
2023-03-10 10:21:07
2023-03-10 10:21:07
2023-05-08 10:01:35
2023-05-05 09:59:12