# openShare ^6.8

分享(可分享文本、图片、链接)

# 请求参数

Prop Type Comment
text String 文本(ios)
imageUrl String 图片地址(ios)
url String 链接 (ios)
title String 标题 (Android)
urcontentl String 内容 (Android)

# 参数代码示例

    let params = {
        text: 'share Text',
        imageUrl: 'localImages/weex_1601027537_0.jpg',
        url: 'http://www.baidu.com'
    }
1
2
3
4
5

# 接口调用示例

      let params = { text: this.text, imageUrl: this.imageUrl, url: this.url }  
      this.$bridge
        .openShare(params)
        .then(res => {    
          this.$alert(res)
        })
        .catch(err => {
          this.$toast(err)
        })

1
2
3
4
5
6
7
8
9
10

# 返回参数

  • 成功时返回
Prop Type Value
msg String success
code Number 0
  • 失败时返回

N/A

# 返回示例

N/A

# FAQ

android端只能分享文本

    let params = {
        title: 'share Title',
        content: 'share content',
    }
1
2
3
4
更新时间: 7/27/2021, 11:23:45 AM