vue插件的使用

使用插件

import Vue from 'vue'
import wxsdk from '@/utils/jssdk-389'
import shareImg from '@/assets/images/favicon.png';


let img = new Image();
img.src = shareImg

export default () => {
  Vue.use(wxsdk,{
    shareData :{
      title : document.title,
      desc: document.keywords,
        link : window.location.href,
      imgUrl: img.src
    }**重点内容**
  });
}

插件使用可传入选项对象option
Vue.use(MyPlugin, { someOption: true })

猜你喜欢

转载自blog.csdn.net/qq_33730322/article/details/82112950