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

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

App.vue文件里写入:

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

边栏推荐
- Master-slave replication principle of MySQL
- Redhat5 installing vmware tools under virtual machine
- unity3d学习笔记
- 组件的通信
- 子组件传递给父组件
- from .onnxruntime_pybind11_state import * # noqa ddddocr运行报错
- ANR 原理及实践
- Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
- toRefs API 与 toRef Api
- Please tell me how to monitor multiple schemas and tables by listening to PgSQL
猜你喜欢

异步组件和Suspense(真实开发中)

How can clothing stores make profits?

AVL树的实现

Answer to the first stage of the assignment of "information security management and evaluation" of the higher vocational group of the 2018 Jiangsu Vocational College skills competition

Leetcode T1165: 日志分析

Maze games based on JS

ANR 原理及实践

RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCreate(handle)`问题解决

基于JS的迷宫小游戏

MySQL的主从复制原理
随机推荐
请教一下,监听pgsql ,怎样可以监听多个schema和table
Basic introduction of JWT
Bus消息总线
Config distributed configuration center
AVL树的实现
Prime partner of Huawei machine test questions
LC 面试题 02.07. 链表相交 & LC142. 环形链表II
栈题目:有效括号的嵌套深度
Network foundation - header, encapsulation and unpacking
How can flinksql calculate the difference between a field before and after update when docking with CDC?
How can brand e-commerce grow against the trend? See the future here!
根据IP获取地市
一条慢SQL拖死整个系统
How to model and simulate the target robot [mathematical / control significance]
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
品牌·咨询标准化
How can gyms improve their competitiveness?
【JDBC以及内部类的讲解】
Test of transform parameters of impdp
Advantages of using net core / why