zoukankan      html  css  js  c++  java
  • 公共组件


    在组件的index.js文件中export出组件
     
    ===============组件==============
    import Component from './Component '
    const MyComponent= {
        install: function(Vue){
            Vue.component('MyComponent',Component )
        }
    }
    export default MyComponent;
    ===============组件==============
     
    ===============方法==============
    export default {
        install(Vue)  {
      Vue.prototype.a= function (path){
                return path
      }
       };
    }
    ===============方法==============
     
    ——————————————————————————————————————————————————
     
    在main.js中定义全局引用
     
    import MyComponent from './MyComponent'
    import function from './function'
     
    Vue.use(MyComponentfrom );    //全局引用组件
    Vue.use(function );      // 全局应用方法
     
     
    这样就可以在全局引用<MyComponentfrom />啦~~
     
  • 相关阅读:
    16-镜像命名的最佳实践
    15-RUN vs CMD vs ENTRYPOINT
    14-Dockerfile常用指令
    13-调试Dockerfile
    12-镜像的缓存特性
    11-Dockerfile构建镜像
    10-构建镜像
    09-镜像的分层结构
    08-base镜像
    07-镜像-最小的镜像
  • 原文地址:https://www.cnblogs.com/HePandeFeng/p/12867956.html
Copyright © 2011-2022 走看看