// 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 阅读次数:6
// 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对象
上一篇:【算法入门05】从尾到头打印链表
java139-多个catch块
vue课程65 使用vue-filter定义全局过滤器
Vue课程45-事件绑定-v-on指令的简写模式
html+css实战164-溢出显示效果overflow
Vue课程37-内容渲染指令
vue课程71 deep选项
angular32-其他指令ng-checked
vue90-使用组件的三个步骤
angular16-$watch监视数据变化
html+css实战156-案例-banner
文章
21549
阅读量
2106725
2024-06-13 08:59:42
2024-06-12 09:26:30
2024-06-12 09:25:36
2024-06-04 09:12:14
2024-05-28 09:35:45
2024-05-24 07:47:12
2023-03-13 09:32:12
2023-03-07 10:04:03
2023-03-10 10:21:07
2023-05-15 09:59:54
2023-03-10 10:21:07
2023-04-06 10:04:22