# convertLocalImageToBase64 ^7.10

转换本地图片成base64数据

# 请求参数

Prop Type Default Comment
filePath String N/A 图片路径(支持相对路径,全路径)

# 接口调用示例

const params = {
    "filePath": ""
}
this.$bridge
  .convertLocalImageToBase64(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })

1
2
3
4
5
6
7
8
9
10
11
12

# 接口返回示例


//成功出参:
{
  errorCode:0, 
  base64: '图片base64数据'
}

1
2
3
4
5
6
7
更新时间: 7/27/2021, 11:23:45 AM