当前位置:网站首页>三十.什么是vm和vc?
三十.什么是vm和vc?
2022-04-23 20:21:00 【这不比博人传燃?】
(1)什么是vm?什么是vc?
- VueComponent的实例对象,以后简称vc(也可称之为:组件实例对象)。
- Vue的实例对象,以后简称vm。
(2)VueComponent组件的本质是什么?
- school组件本质是一个名为VueComponent的构造函数,且不是程序员定义的,是Vue.extend生成的。
- 我们只需要写或,Vue解析时会帮我们创建school组件的实例对象,即Vue帮我们执行的:new VueComponent(options)。
- 特别注意:每次调用Vue.extend,返回的都是一个全新的VueComponent!!!!
(3)关于this指向:
- vc组件配置中:data函数、methods中的函数、watch中的函数、computed中的函数 它们的this均是【VueComponent实例对象】。
- new Vue(options)即vm配置中:data函数、methods中的函数、watch中的函数、computed中的函数 它们的this均是【Vue实例对象】。
来源:尚硅谷张天禹老师视频,在讲vm和vc的一个重要内置关系时提及到的内容。
版权声明
本文为[这不比博人传燃?]所创,转载请带上原文链接,感谢
https://blog.csdn.net/HSH541/article/details/124342333
边栏推荐
- nc基础用法3
- 腾讯邱东洋:深度模型推理加速的术与道
- DNS cloud school rising posture! Three advanced uses of authoritative DNS
- Leetcode dynamic planning training camp (1-5 days)
- go-zero框架数据库方面避坑指南
- DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
- . Ren -- the intimate artifact in the field of vertical Recruitment!
- How to protect ECs from hacker attacks?
- SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
- R语言使用timeROC包计算存在竞争风险情况下的生存资料多时间AUC值、使用cox模型、并添加协变量、R语言使用timeROC包的plotAUCcurve函数可视化多时间生存资料的AUC曲线
猜你喜欢
考研英语唐叔的语法课笔记
[graph theory brush question-4] force deduction 778 Swimming in a rising pool
Customize timeline component styles
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
Handwritten Google's first generation distributed computing framework MapReduce
Operation of numpy array
WordPress plug-in: WP CHINA Yes solution to slow domestic access to the official website
Redis cache penetration, cache breakdown, cache avalanche
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
What is the difference between a host and a server?
随机推荐
DNS cloud school | quickly locate DNS resolution exceptions and keep these four DNS status codes in mind
Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
[graph theory brush question-4] force deduction 778 Swimming in a rising pool
R language ggplot2 visualization: ggplot2 visualizes the scatter diagram and uses geom_ mark_ The ellipse function adds ellipses around data points of data clusters or data groups for annotation
Installation and use of NVM
Solution to PowerDesigner's failure to connect to MySQL in x64 system
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
Implementation of mypromise
Introduction to electron Tutorial 4 - switching application topics
Use the rolling division method to find the maximum common divisor of two numbers
还在用 ListView?使用 AnimatedList 让列表元素动起来
Handwritten Google's first generation distributed computing framework MapReduce
Historical track data reading of Holux m1200-e Bluetooth GPS track recorder
How to protect ECs from hacker attacks?
Redis installation (centos7 command line installation)
Fundamentals of network communication (LAN, Wan, IP address, port number, protocol, encapsulation and distribution)
nc基础用法2
Research on open source OCR engine
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
Latest investigation and progress of building intelligence based on sati