本帖最后由 afly 于 2023-12-11 14:49 编辑
代码demo,在安卓上有问题,ios上没有问题
export const SpreadTest = () => {
const initCallback = React.useCallback((spread) => {
setTimeout(() => {
const sheet = spread.getActiveSheet()
console.error("执行之前--- 键盘未弹起")
spread.commandManager().execute({
cmd: 'clipboardPaste',
sheetName: sheet.name(),
fromSheet: sheet,
fromRanges: [
new Spread.Sheets.Range(0, 0, 1 , 1),
],
pastedRanges: [
new Spread.Sheets.Range(2, 2, 1, 1),
],
isCutting: false,
pasteOption: Spread.Sheets.ClipboardPasteOptions.all,
});
console.error("执行之后--- 键盘弹起")
}, 1000)
}, [])
return (
<div style={{width: "100%", height: "600px"}}>
<BaseSpreadSheets
workbookInitialized={initCallback}
allowContextMenu
>
<Worksheet>
</Worksheet>
</BaseSpreadSheets>
</div>
)
}
|
|