本文介绍: pathToBase64(需要转的图片地址).then(e=>{

1. 安装插件

这个插件中有个两种方法:
1. pathToBase64()图像路径转换为base64
2. base64ToPath()图像base64保存为文件

npm i image-tools –save

2. 引入插件

import { pathToBase64 } from ‘image-tools’

3.使用

let filePath = ”

 pathToBase64(需要转的图片地址).then(e=>{
        filePath = e
        // console.log(‘base64’,filePath);
      })

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注