Vue 微信微博分享

微博分享:

   async wzjk() {
         
          const {
            data: res
          } = await this.$http.get('/article/' + this.xzlistid, {})
          this.xzxqlist = res.data
          // 微博分享赋值 document.url 是获取当前页面url  **使用encodeURIComponent 转化路径**因为路径被之前转化了
   this.urlwbo="http://service.weibo.com/share/share.php?appkey=3639878664&title="+res.data.name+"(分享来自 @铁盒智库) 详情猛戳:&url="+encodeURIComponent(document.URL)+"&searchPic=false&style=simple"


    
    
          console.log(res.data)
          
          if(this.xzxqlist.digest==null || this.xzxqlist.digest==' '){
            this.isdigest=false
           
    
          }else{
          
            this.isdigest=true
          }
          // console.log(res.data)
          
        },

微信分享:

后台直接返回一个图片,前台赋值就行了

你可能感兴趣的:(Vue)