饿了么的Element UI还不支持VUE3
集成第三方组件,一般都在main.ts里加配置
将布局写在APP.vue,将各页面变化的部分放在各自路由里面
不变的部分写到App.vue,变化的部分写到router-view
独一无二的组件the-xxx
一般<tem>第一 <script>第二 <style>第三
引入组件:(组件名与name一致)
- import组件页面
- 在components中加入该组件
- 在template中使用组件
Maximum call stack size exceeded表示栈溢出,常出现在递归,组件嵌套等
组件名字不加the的话,不要用h5关键字,比如header、footer、section
把header、footer独立出来:
- 在components中新建the-header.vue+the-footer.vue,在<script>定义name
- 在App.vue中import引入组件页面,在components加入组件
- 在template中使用