接口: IFRangeSheetDrawingMixin
继承于
方法
insertCellImageAsync()
insertCellImageAsync(file): Promise<boolean>;Inserts an image into the current cell.
参数
| 参数 | 类型 | 描述 | 
|---|---|---|
file | string | File | File or URL string | 
返回
Promise<boolean>
True if the image is inserted successfully, otherwise false
示例
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();
 
// Insert an image into the cell A10
const fRange = fWorksheet.getRange('A10');
const result = await fRange.insertCellImageAsync('https://avatars.githubusercontent.com/u/61444807?s=48&v=4');
console.log(result);