mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-23 18:00:27 +08:00
feat: 新增组件多选和右键成组按钮
This commit is contained in:
parent
3537427846
commit
3a066fc9bb
@ -1,3 +1,9 @@
|
|||||||
|
// 鼠标点击左右键
|
||||||
|
export enum MouseEventButton {
|
||||||
|
LEFT = 1,
|
||||||
|
RIGHT = 2
|
||||||
|
}
|
||||||
|
|
||||||
// 页面拖拽键名
|
// 页面拖拽键名
|
||||||
export enum DragKeyEnum {
|
export enum DragKeyEnum {
|
||||||
DROG_KEY = 'ChartData'
|
DROG_KEY = 'ChartData'
|
||||||
@ -27,6 +33,9 @@ export enum WinKeyboard {
|
|||||||
CTRL = 'ctrl',
|
CTRL = 'ctrl',
|
||||||
SHIFT = 'shift',
|
SHIFT = 'shift',
|
||||||
ALT = ' alt',
|
ALT = ' alt',
|
||||||
|
CTRL_SOURCE_KEY = "control",
|
||||||
|
SHIFT_SOURCE_KEY = "shift",
|
||||||
|
ALT_SOURCE_KEY = "alt"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mac 键盘枚举
|
// Mac 键盘枚举
|
||||||
@ -35,4 +44,7 @@ export enum MacKeyboard {
|
|||||||
CTRL = '⌘',
|
CTRL = '⌘',
|
||||||
SHIFT = '⇧',
|
SHIFT = '⇧',
|
||||||
ALT = '⌥',
|
ALT = '⌥',
|
||||||
|
CTRL_SOURCE_KEY = "⌘",
|
||||||
|
SHIFT_SOURCE_KEY = "⇧",
|
||||||
|
ALT_SOURCE_KEY = "⌥"
|
||||||
}
|
}
|
@ -80,7 +80,9 @@ import {
|
|||||||
Scale as ScaleIcon,
|
Scale as ScaleIcon,
|
||||||
FitToScreen as FitToScreenIcon,
|
FitToScreen as FitToScreenIcon,
|
||||||
FitToHeight as FitToHeightIcon,
|
FitToHeight as FitToHeightIcon,
|
||||||
FitToWidth as FitToWidthIcon
|
FitToWidth as FitToWidthIcon,
|
||||||
|
Carbon3DCursor as Carbon3DCursorIcon,
|
||||||
|
Carbon3DSoftware as Carbon3DSoftwareIcon
|
||||||
} from '@vicons/carbon'
|
} from '@vicons/carbon'
|
||||||
|
|
||||||
const ionicons5 = {
|
const ionicons5 = {
|
||||||
@ -234,7 +236,11 @@ const carbon = {
|
|||||||
ScaleIcon,
|
ScaleIcon,
|
||||||
FitToScreenIcon,
|
FitToScreenIcon,
|
||||||
FitToHeightIcon,
|
FitToHeightIcon,
|
||||||
FitToWidthIcon
|
FitToWidthIcon,
|
||||||
|
// 成组
|
||||||
|
Carbon3DCursorIcon,
|
||||||
|
// 解组
|
||||||
|
Carbon3DSoftwareIcon
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.xicons.org/#/ 还有很多
|
// https://www.xicons.org/#/ 还有很多
|
||||||
|
@ -172,7 +172,7 @@ export const useChartEditStore = defineStore({
|
|||||||
this.targetChart.selectId = []
|
this.targetChart.selectId = []
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 新增
|
// 多选
|
||||||
if(push) {
|
if(push) {
|
||||||
// 字符串
|
// 字符串
|
||||||
if(isString(selectId)) {
|
if(isString(selectId)) {
|
||||||
|
@ -51,7 +51,8 @@ export enum HistoryStackItemEnum {
|
|||||||
|
|
||||||
// 历史记录项类型
|
// 历史记录项类型
|
||||||
export interface HistoryItemType {
|
export interface HistoryItemType {
|
||||||
[HistoryStackItemEnum.ID]: string
|
// 会有同时操作多个组件场景
|
||||||
|
[HistoryStackItemEnum.ID]: string | string[]
|
||||||
[HistoryStackItemEnum.TARGET_TYPE]: HistoryTargetTypeEnum
|
[HistoryStackItemEnum.TARGET_TYPE]: HistoryTargetTypeEnum
|
||||||
[HistoryStackItemEnum.ACTION_TYPE]: HistoryActionTypeEnum
|
[HistoryStackItemEnum.ACTION_TYPE]: HistoryActionTypeEnum
|
||||||
[HistoryStackItemEnum.HISTORY_DATA]: CreateComponentType | EditCanvasType
|
[HistoryStackItemEnum.HISTORY_DATA]: CreateComponentType | EditCanvasType
|
||||||
|
@ -99,6 +99,11 @@ const shortcutKeyOptions = [
|
|||||||
win: `${WinKeyboard.CTRL.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + Z `,
|
win: `${WinKeyboard.CTRL.toUpperCase()} + ${WinKeyboard.SHIFT.toUpperCase()} + Z `,
|
||||||
mac: `${MacKeyboard.CTRL.toUpperCase()} + ${MacKeyboard.SHIFT.toUpperCase()} + Z `,
|
mac: `${MacKeyboard.CTRL.toUpperCase()} + ${MacKeyboard.SHIFT.toUpperCase()} + Z `,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '多选',
|
||||||
|
win: `${WinKeyboard.CTRL.toUpperCase()} + 🖱️ `,
|
||||||
|
mac: `${MacKeyboard.CTRL_SOURCE_KEY.toUpperCase()} + 🖱️ `,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
const closeHandle = () => {
|
const closeHandle = () => {
|
||||||
emit('update:modelShow', false)
|
emit('update:modelShow', false)
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
import { DragKeyEnum } from '@/enums/editPageEnum'
|
import { DragKeyEnum, MouseEventButton, WinKeyboard, MacKeyboard } from '@/enums/editPageEnum'
|
||||||
import { createComponent } from '@/packages'
|
import { createComponent } from '@/packages'
|
||||||
import { ConfigType } from '@/packages/index.d'
|
import { ConfigType } from '@/packages/index.d'
|
||||||
import {
|
import { CreateComponentType, PickCreateComponentType } from '@/packages/index.d'
|
||||||
CreateComponentType,
|
|
||||||
PickCreateComponentType,
|
|
||||||
} from '@/packages/index.d'
|
|
||||||
import { useContextMenu } from '@/views/chart/hooks/useContextMenu.hook'
|
import { useContextMenu } from '@/views/chart/hooks/useContextMenu.hook'
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
|
import { EditCanvasTypeEnum } from '@/store/modules/chartEditStore/chartEditStore.d'
|
||||||
@ -35,10 +32,7 @@ export const dragHandle = async (e: DragEvent) => {
|
|||||||
// 创建新图表组件
|
// 创建新图表组件
|
||||||
let newComponent: CreateComponentType = await createComponent(dropData)
|
let newComponent: CreateComponentType = await createComponent(dropData)
|
||||||
|
|
||||||
newComponent.setPosition(
|
newComponent.setPosition(e.offsetX - newComponent.attr.w / 2, e.offsetY - newComponent.attr.h / 2)
|
||||||
e.offsetX - newComponent.attr.w / 2,
|
|
||||||
e.offsetY - newComponent.attr.h / 2
|
|
||||||
)
|
|
||||||
chartEditStore.addComponentList(newComponent, false, true)
|
chartEditStore.addComponentList(newComponent, false, true)
|
||||||
chartEditStore.setTargetSelectChart(newComponent.id)
|
chartEditStore.setTargetSelectChart(newComponent.id)
|
||||||
loadingFinish()
|
loadingFinish()
|
||||||
@ -57,10 +51,7 @@ export const dragoverHandle = (e: DragEvent) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// * 不拦截默认行为点击
|
// * 不拦截默认行为点击
|
||||||
export const mousedownHandleUnStop = (
|
export const mousedownHandleUnStop = (e: MouseEvent, item?: CreateComponentType) => {
|
||||||
e: MouseEvent,
|
|
||||||
item?: CreateComponentType
|
|
||||||
) => {
|
|
||||||
if (item) {
|
if (item) {
|
||||||
chartEditStore.setTargetSelectChart(item.id)
|
chartEditStore.setTargetSelectChart(item.id)
|
||||||
return
|
return
|
||||||
@ -70,13 +61,42 @@ export const mousedownHandleUnStop = (
|
|||||||
|
|
||||||
// * 移动图表
|
// * 移动图表
|
||||||
export const useMouseHandle = () => {
|
export const useMouseHandle = () => {
|
||||||
// 点击事件(包含移动事件)
|
// * Click 事件, 松开鼠标触发
|
||||||
|
const mouseClickHandle = (e: MouseEvent, item: CreateComponentType) => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
// 若此时按下了 CTRL, 表示多选
|
||||||
|
if (
|
||||||
|
window.$KeyboardActive?.has(WinKeyboard.CTRL_SOURCE_KEY) ||
|
||||||
|
window.$KeyboardActive?.has(MacKeyboard.CTRL_SOURCE_KEY)
|
||||||
|
) {
|
||||||
|
chartEditStore.setTargetSelectChart(item.id, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// * 按下事件(包含移动事件)
|
||||||
const mousedownHandle = (e: MouseEvent, item: CreateComponentType) => {
|
const mousedownHandle = (e: MouseEvent, item: CreateComponentType) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
|
|
||||||
onClickOutSide()
|
onClickOutSide()
|
||||||
|
|
||||||
|
// 按下左键 + CTRL
|
||||||
|
if (
|
||||||
|
e.buttons === MouseEventButton.LEFT &&
|
||||||
|
(window.$KeyboardActive?.has(WinKeyboard.CTRL_SOURCE_KEY) ||
|
||||||
|
window.$KeyboardActive?.has(MacKeyboard.CTRL_SOURCE_KEY))
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
// 按下右键 + 选中多个
|
||||||
|
if (e.buttons === MouseEventButton.RIGHT && chartEditStore.getTargetChart.selectId.length > 1) return
|
||||||
|
|
||||||
|
// 选中当前目标组件
|
||||||
chartEditStore.setTargetSelectChart(item.id)
|
chartEditStore.setTargetSelectChart(item.id)
|
||||||
|
|
||||||
|
// 按下右键
|
||||||
|
if (e.buttons === MouseEventButton.RIGHT) return
|
||||||
|
|
||||||
const scale = chartEditStore.getEditCanvas.scale
|
const scale = chartEditStore.getEditCanvas.scale
|
||||||
const width = chartEditStore.getEditCanvasConfig.width
|
const width = chartEditStore.getEditCanvasConfig.width
|
||||||
const height = chartEditStore.getEditCanvasConfig.height
|
const height = chartEditStore.getEditCanvasConfig.height
|
||||||
@ -141,15 +161,11 @@ export const useMouseHandle = () => {
|
|||||||
chartEditStore.setTargetHoverChart(undefined)
|
chartEditStore.setTargetHoverChart(undefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
return { mousedownHandle, mouseenterHandle, mouseleaveHandle }
|
return { mouseClickHandle, mousedownHandle, mouseenterHandle, mouseleaveHandle }
|
||||||
}
|
}
|
||||||
|
|
||||||
// * 移动锚点
|
// * 移动锚点
|
||||||
export const useMousePointHandle = (
|
export const useMousePointHandle = (e: MouseEvent, point: string, attr: PickCreateComponentType<'attr'>) => {
|
||||||
e: MouseEvent,
|
|
||||||
point: string,
|
|
||||||
attr: PickCreateComponentType<'attr'>
|
|
||||||
) => {
|
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
:index="index"
|
:index="index"
|
||||||
:style="useComponentStyle(item.attr, index)"
|
:style="useComponentStyle(item.attr, index)"
|
||||||
:item="item"
|
:item="item"
|
||||||
|
@click="mouseClickHandle($event, item)"
|
||||||
@mousedown="mousedownHandle($event, item)"
|
@mousedown="mousedownHandle($event, item)"
|
||||||
@mouseenter="mouseenterHandle($event, item)"
|
@mouseenter="mouseenterHandle($event, item)"
|
||||||
@mouseleave="mouseleaveHandle($event, item)"
|
@mouseleave="mouseleaveHandle($event, item)"
|
||||||
@ -87,7 +88,7 @@ const { handleContextMenu } = useContextMenu()
|
|||||||
useLayout()
|
useLayout()
|
||||||
|
|
||||||
// 点击事件
|
// 点击事件
|
||||||
const { mouseenterHandle, mouseleaveHandle, mousedownHandle } = useMouseHandle()
|
const { mouseenterHandle, mouseleaveHandle, mousedownHandle, mouseClickHandle } = useMouseHandle()
|
||||||
|
|
||||||
// 主题色
|
// 主题色
|
||||||
const themeSetting = computed(() => {
|
const themeSetting = computed(() => {
|
||||||
|
@ -6,82 +6,85 @@ import { icon } from '@/plugins'
|
|||||||
import { MenuOptionsItemType } from './useContextMenu.hook.d'
|
import { MenuOptionsItemType } from './useContextMenu.hook.d'
|
||||||
import { MenuEnum } from '@/enums/editPageEnum'
|
import { MenuEnum } from '@/enums/editPageEnum'
|
||||||
|
|
||||||
const {
|
const { CopyIcon, CutIcon, ClipboardOutlineIcon, TrashIcon, ChevronDownIcon, ChevronUpIcon } = icon.ionicons5
|
||||||
CopyIcon,
|
const { UpToTopIcon, DownToBottomIcon, PaintBrushIcon, Carbon3DSoftwareIcon, Carbon3DCursorIcon } = icon.carbon
|
||||||
CutIcon,
|
|
||||||
ClipboardOutlineIcon,
|
|
||||||
TrashIcon,
|
|
||||||
ChevronDownIcon,
|
|
||||||
ChevronUpIcon,
|
|
||||||
} = icon.ionicons5
|
|
||||||
const { UpToTopIcon, DownToBottomIcon, PaintBrushIcon } = icon.carbon
|
|
||||||
|
|
||||||
const chartEditStore = useChartEditStore()
|
const chartEditStore = useChartEditStore()
|
||||||
|
|
||||||
// * 默认选项
|
// * 默认单组件选项
|
||||||
const defaultOptions: MenuOptionsItemType[] = [
|
const defaultOptions: MenuOptionsItemType[] = [
|
||||||
{
|
{
|
||||||
label: '复制',
|
label: '复制',
|
||||||
key: MenuEnum.COPY,
|
key: MenuEnum.COPY,
|
||||||
icon: renderIcon(CopyIcon),
|
icon: renderIcon(CopyIcon),
|
||||||
fnHandle: chartEditStore.setCopy,
|
fnHandle: chartEditStore.setCopy
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '剪切',
|
label: '剪切',
|
||||||
key: MenuEnum.CUT,
|
key: MenuEnum.CUT,
|
||||||
icon: renderIcon(CutIcon),
|
icon: renderIcon(CutIcon),
|
||||||
fnHandle: chartEditStore.setCut,
|
fnHandle: chartEditStore.setCut
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '粘贴',
|
label: '粘贴',
|
||||||
key: MenuEnum.PARSE,
|
key: MenuEnum.PARSE,
|
||||||
icon: renderIcon(ClipboardOutlineIcon),
|
icon: renderIcon(ClipboardOutlineIcon),
|
||||||
fnHandle: chartEditStore.setParse,
|
fnHandle: chartEditStore.setParse
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
key: 'd1',
|
key: 'd1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '置顶',
|
label: '置顶',
|
||||||
key: MenuEnum.TOP,
|
key: MenuEnum.TOP,
|
||||||
icon: renderIcon(UpToTopIcon),
|
icon: renderIcon(UpToTopIcon),
|
||||||
fnHandle: chartEditStore.setTop,
|
fnHandle: chartEditStore.setTop
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '置底',
|
label: '置底',
|
||||||
key: MenuEnum.BOTTOM,
|
key: MenuEnum.BOTTOM,
|
||||||
icon: renderIcon(DownToBottomIcon),
|
icon: renderIcon(DownToBottomIcon),
|
||||||
fnHandle: chartEditStore.setBottom,
|
fnHandle: chartEditStore.setBottom
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '上移一层',
|
label: '上移一层',
|
||||||
key: MenuEnum.UP,
|
key: MenuEnum.UP,
|
||||||
icon: renderIcon(ChevronUpIcon),
|
icon: renderIcon(ChevronUpIcon),
|
||||||
fnHandle: chartEditStore.setUp,
|
fnHandle: chartEditStore.setUp
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '下移一层',
|
label: '下移一层',
|
||||||
key: MenuEnum.DOWN,
|
key: MenuEnum.DOWN,
|
||||||
icon: renderIcon(ChevronDownIcon),
|
icon: renderIcon(ChevronDownIcon),
|
||||||
fnHandle: chartEditStore.setDown,
|
fnHandle: chartEditStore.setDown
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'divider',
|
type: 'divider',
|
||||||
key: 'd2',
|
key: 'd2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '清空剪贴板',
|
label: '清空剪贴板',
|
||||||
key: MenuEnum.CLEAR,
|
key: MenuEnum.CLEAR,
|
||||||
icon: renderIcon(PaintBrushIcon),
|
icon: renderIcon(PaintBrushIcon),
|
||||||
fnHandle: chartEditStore.setRecordChart,
|
fnHandle: chartEditStore.setRecordChart
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
key: MenuEnum.DELETE,
|
key: MenuEnum.DELETE,
|
||||||
icon: renderIcon(TrashIcon),
|
icon: renderIcon(TrashIcon),
|
||||||
fnHandle: chartEditStore.removeComponentList,
|
fnHandle: chartEditStore.removeComponentList
|
||||||
},
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
// * 默认多选组件选项
|
||||||
|
const defaultMultiSelectionOptions: MenuOptionsItemType[] = [
|
||||||
|
{
|
||||||
|
label: '成组',
|
||||||
|
key: MenuEnum.COPY,
|
||||||
|
icon: renderIcon(Carbon3DSoftwareIcon),
|
||||||
|
fnHandle: chartEditStore.setCopy
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
// * 无数据传递拥有的选项
|
// * 无数据传递拥有的选项
|
||||||
@ -126,7 +129,7 @@ const handleContextMenu = (
|
|||||||
// 隐藏选项列表
|
// 隐藏选项列表
|
||||||
hideOptionsList?: MenuEnum[],
|
hideOptionsList?: MenuEnum[],
|
||||||
// 挑选选项列表
|
// 挑选选项列表
|
||||||
pickOptionsList?: MenuEnum[],
|
pickOptionsList?: MenuEnum[]
|
||||||
) => {
|
) => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ -136,8 +139,13 @@ const handleContextMenu = (
|
|||||||
}
|
}
|
||||||
chartEditStore.setRightMenuShow(false)
|
chartEditStore.setRightMenuShow(false)
|
||||||
|
|
||||||
// * 设置默认选项
|
// * 多选默认选项
|
||||||
menuOptions.value = defaultOptions
|
if (chartEditStore.getTargetChart.selectId.length > 1) {
|
||||||
|
menuOptions.value = defaultMultiSelectionOptions
|
||||||
|
} else {
|
||||||
|
// * 单选默认选项
|
||||||
|
menuOptions.value = defaultOptions
|
||||||
|
}
|
||||||
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
menuOptions.value = pickOption(menuOptions.value, defaultNoItemKeys)
|
menuOptions.value = pickOption(menuOptions.value, defaultNoItemKeys)
|
||||||
@ -163,7 +171,6 @@ const handleContextMenu = (
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export const useContextMenu = () => {
|
export const useContextMenu = () => {
|
||||||
|
|
||||||
// 设置默认项
|
// 设置默认项
|
||||||
menuOptions.value = defaultOptions
|
menuOptions.value = defaultOptions
|
||||||
|
|
||||||
@ -175,9 +182,7 @@ export const useContextMenu = () => {
|
|||||||
// * 事件处理
|
// * 事件处理
|
||||||
const handleMenuSelect = (key: string) => {
|
const handleMenuSelect = (key: string) => {
|
||||||
chartEditStore.setRightMenuShow(false)
|
chartEditStore.setRightMenuShow(false)
|
||||||
const targetItem: MenuOptionsItemType[] = menuOptions.value.filter(
|
const targetItem: MenuOptionsItemType[] = menuOptions.value.filter((e: MenuOptionsItemType) => e.key === key)
|
||||||
(e: MenuOptionsItemType) => e.key === key
|
|
||||||
)
|
|
||||||
|
|
||||||
menuOptions.value.forEach((e: MenuOptionsItemType) => {
|
menuOptions.value.forEach((e: MenuOptionsItemType) => {
|
||||||
if (e.key === key) {
|
if (e.key === key) {
|
||||||
@ -195,6 +200,6 @@ export const useContextMenu = () => {
|
|||||||
handleContextMenu,
|
handleContextMenu,
|
||||||
onClickOutSide,
|
onClickOutSide,
|
||||||
handleMenuSelect,
|
handleMenuSelect,
|
||||||
mousePosition: chartEditStore.getMousePosition,
|
mousePosition: chartEditStore.getMousePosition
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,14 +77,14 @@ const macKeyList: Array<string> = [
|
|||||||
|
|
||||||
// 处理键盘记录
|
// 处理键盘记录
|
||||||
const keyRecordHandle = () => {
|
const keyRecordHandle = () => {
|
||||||
document.onkeydown = throttle((e: KeyboardEvent) => {
|
document.onkeydown = (e: KeyboardEvent) => {
|
||||||
if(window.$KeyboardActive) window.$KeyboardActive.add(e.key.toLocaleLowerCase())
|
if(window.$KeyboardActive) window.$KeyboardActive.add(e.key.toLocaleLowerCase())
|
||||||
else window.$KeyboardActive = new Set([e.key])
|
else window.$KeyboardActive = new Set([e.key.toLocaleLowerCase()])
|
||||||
}, 200)
|
}
|
||||||
|
|
||||||
document.onkeyup = throttle((e: KeyboardEvent) => {
|
document.onkeyup = (e: KeyboardEvent) => {
|
||||||
if(window.$KeyboardActive) window.$KeyboardActive.delete(e.key.toLocaleLowerCase())
|
if(window.$KeyboardActive) window.$KeyboardActive.delete(e.key.toLocaleLowerCase())
|
||||||
}, 200)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化监听事件
|
// 初始化监听事件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user