jexcel目前清除操作是选中之后按键盘的backspace键或者按delete键清除,操作便捷性上没有很方便,所以在右键菜单上加清除内容功能(加其他菜单功能都是类似的),实现用鼠标操作即可
option = {
contextMenu: function (obj, x, y, e) {
let items = []
if (jexcel.current.highlighted.length) {
items.push({
title: '清除内容',
onclick: function () {
jexcel.current.setValue(jexcel.current.highlighted, '')
},
})
}
}
}
效果图:
image.png