脚本宝典收集整理的这篇文章主要介绍了MVVM开发总结——vue组件(你所需要知道的),脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
随着模块化开发的理念越来越被开发者所重视,如何快速高效的开发项目成为了开发中所要注意的重点。在vue.js中组件系统作为一个重要的概念,它提供的组件可以独立、重复的使用来构建大型的应用。组件可以扩展HTML元素,封装可重用的HTML代码,我们可以将组件看作自定义的HTML元素。
1.使用 Vue.extend()创建组件构造器
2.使用 Vue.componnet()注册组件
3.在 Vue的实例作用域范围内使用组件