1. 安装 ``` npm i custom-test-util ``` 2. 使用 ``` import {urlToBase64} from 'custom-test-util' /* url: 图片地址 type: image/*, 图片类型 callback(base64): 转化后的数据是base64参数 */ urlToBase64(url, type, callback) ```
published 1.0.1 2 years ago
1. 安装 ``` npm i custom-test-util ``` 2. 使用 ``` import {urlToBase64} from 'custom-test-util' /* url: 图片地址 type: image/*, 图片类型 callback(base64): 转化后的数据是base64参数 */ urlToBase64(url, type, callback) ```