当前位置:网站首页>组件的嵌套和拆分
组件的嵌套和拆分
2022-07-07 03:12:00 【要成为光的女人】
如果我们一个应用程序将所有的逻辑放在一个组件中,那么这个组件就会变成非常的臃肿和非常难以维护;
所以组件化的核心思想应该是对组件进行拆分,拆成一个个小的组件;
在将这些组件组合嵌套在一起,最终形成我们的应用程序;
1.注意在vscode里面去写.vue文件的时候,vscode本身是不支持的,在这个里面写的所有代码是没有高亮提示的
官方插件推荐:Vetur 这个插件(高亮提示)

Vu3 Snippets 代码片段生成(提高开发效率)

App.vue文件里写入:

如果想要在App.vue想要使用其他的组件,有两种方式:
- 全部注册成全局组件(不建议:全局组件一旦注册就不会销毁,这样会浪费性能)
- 局部注册,用到哪个组件注册。

边栏推荐
- 2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
- 2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
- $parent(获取父组件) 和 $root(获取根组件)
- Leetcode T1165: 日志分析
- Complete process of MySQL SQL
- MYSQL----导入导出&视图&索引&执行计划
- Learning records on July 4, 2022
- Composition API 前提
- Matlab tips (29) polynomial fitting plotfit
- unity3d学习笔记
猜你喜欢

FPGA课程:JESD204B的应用场景(干货分享)
SVN version management in use replacement release and connection reset

How to share the same storage among multiple kubernetes clusters

【NOI模拟赛】区域划分(结论,构造)

$refs:组件中获取元素对象或者子组件实例:

大促过后,销量与流量兼具,是否真的高枕无忧?

Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park

Brand · consultation standardization

Several index utilization of joint index ABC
![How to model and simulate the target robot [mathematical / control significance]](/img/bd/79f6338751b6773859435c54430ec3.png)
How to model and simulate the target robot [mathematical / control significance]
随机推荐
Use of completable future
readonly 只读
$parent(获取父组件) 和 $root(获取根组件)
基于JS的迷宫小游戏
Exception of DB2 getting table information: caused by: com ibm. db2.jcc. am. SqlException: [jcc][t4][1065][12306][4.25.13]
Learning records on July 4, 2022
Basic process of network transmission using tcp/ip four layer model
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
Maze games based on JS
子组件传递给父组件
健身房如何提高竞争力?
算法---比特位计数(Kotlin)
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
Bus message bus
MYSQL----导入导出&视图&索引&执行计划
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
Several index utilization of joint index ABC
MATLAB小技巧(30)非线性拟合 lsqcurefit
2018年江苏省职业院校技能大赛高职组“信息安全管理与评估”赛项任务书第二阶段答案
Brand · consultation standardization