久久久久久AV无码免费看大片,亚洲一区精品人人爽人人躁,国产成人片无码免费爱线观看,亚洲AV成人无码精品网站,为什么晚上搞的时候要盖被子

通過(guò)vue.use來(lái)加載自定義的vue插件

時(shí)間:2019-09-08 11:23:16 類型:vue
字號(hào):    

1. 在components下定義pub.js  

//方法1 
exports.install = function (Vue, options) {
      Vue.prototype.baseUrl = 'http://www.y46k9ti.cn/';
      Vue.prototype.getMyname = function(){
                console.log("南昌雅騰")
      }
 };
//方法2
export default{
    install(Vue,options){
        Vue.prototype.baseUrl = 'http://www.y46k9ti.cn/';
        Vue.prototype.getMyname = function(){
                  console.log("南昌雅騰")
        }
    }
}

2. 在main.js/main.ts文件中引用 


import pub from './components/pub';
  Vue.use(pub);
3. 在.vue文件中調(diào)用
 console.log(this.baseUrl);
 this.getMyname();