vue 代码执行顺序、mixins用法

2019-08-29  本文已影响0人  jane819
import { Component, Vue } from 'vue-property-decorator'
import { Toast } from 'vant'

const doman = process.env.DOMAIN
@Component
export default class shareMixins extends Vue {
 mounted() {
   this.shareMessage()
 }

 shareMessage() {
   const shareData = {
     title: '包大师邀你免费体验清洗服务',
     link: `${doman}/activities/wash-new/`,
     imgUrl: 'https://img.ibaodashi.com/20190531/c732ce61559c03907f9eda76280ace3d.png',
     desc: '下载APP,即享1888元礼包券'
   }
   window.wxshare.ready(() => {
     // 分享给朋友圈
     window.wxshare.onMenuShareTimeline(shareData, {
       success() {
         Toast('分享成功')
       }
     })
     // 分享给朋友
     window.wxshare.onMenuShareAppMessage(shareData, {
       success() {
         Toast('分享成功')
       }
     })
   })
 }
}
  import { Component, Mixins } from 'vue-property-decorator'
  import share from '@/mixins/share'
  export default class Login extends Mixins(share) {
  内容正常写就ok
  }
上一篇下一篇

猜你喜欢

热点阅读