博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vue-cli自己写的全局组件使用
阅读量:6911 次
发布时间:2019-06-27

本文共 427 字,大约阅读时间需要 1 分钟。

hot3.png

现在components文件夹下新建一个专门放置自己封装组件的文件夹,这里取名为jqCom

然后在这个文件夹下写vue文件以封装想要的组件

然后在jqCom根目录下新建一个index.js

/**index.js**import myAcountFormHeader from './account/AcountFormHeader.vue'const MyCom = {	install: function(Vue){		Vue.component('AcountFormHeader',myAcountFormHeader);	}}export default MyCom

然后在main.js那里写以下代码

/** * 自定义的全局组件  */import jqCom from './components/jqCom'Vue.use(jqCom);

转载于:https://my.oschina.net/daladida/blog/1810298

你可能感兴趣的文章
我的友情链接
查看>>
程序员是吃青春饭的?
查看>>
错误:docker-ce conflicts with 2:docker-1.13.1-74.git
查看>>
JDK并发包之LinkedBlockingQueue
查看>>
响应式设计(Response Web Design)实践
查看>>
喜迎2015年新年:坦克大战(Robocode)游戏编程比赛图文总结
查看>>
ASP.NET MVC 5 - 给数据模型添加校验器
查看>>
矩表 - 现代数据分析中必不可少的报表工具
查看>>
Ansible 一键配置安装Keepalived+Nginx作为前端,httpd+php作为后端
查看>>
服务器维护安全策略方案
查看>>
maven-assembly-plugin 的includeBaseDirectory研究
查看>>
SSL证书相关技巧 -- 如何访问一个网站,其证书不在系统证书列表中
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
【hadoop】17.MapReduce-wordcount案例
查看>>
MyBatis标签
查看>>
C-问题
查看>>
Spark SQL编程
查看>>
spring概览
查看>>
日期和时间模式
查看>>