fix: 工具栏编辑器报错

This commit is contained in:
AncTe committed 2024-01-19 22:18:20 +08:00
1 parent ad2cb0b757
commit f4757d7cc3
4 files changed
+4 -28

No files matched your search

-21
View File
@@ -321,24 +321,3 @@ CustomToolbar.register(
};
}
);
hook.once('reset', () => {
const toolbar = new CustomToolbar('test');
toolbar
.add<'hotkey'>({
id: 'test1',
type: 'hotkey',
assist: 0,
key: KeyCode.KeyX
})
.add<'assistKey'>({
id: 'test2',
type: 'assistKey',
assist: KeyCode.Ctrl
})
.add<'item'>({
id: 'test3',
type: 'item',
item: 'book'
});
});
+1 -4
View File
@@ -114,10 +114,7 @@ function KeyToolEdtior(props: CustomToolbarProps<'hotkey'>) {
};
const getKeyShow = (key: KeyCode, assist: number) => {
return (
unwarpAssist(assist) +
(key === KeyCode.Unknown ? '' : KeyCodeUtils.toString(key))
);
return unwarpAssist(assist) + KeyCodeUtils.toString(key);
};
return (
+2 -2
View File
@@ -45,7 +45,7 @@
:type="isMobile ? 'horizontal' : 'vertical'"
></a-divider>
<div id="tool-info">
<div id="tool-detail">
<div id="tool-detail" v-if="!!bar">
<Scroll class="tool-item-list-scroll">
<div class="tool-item-list">
<div
@@ -152,7 +152,7 @@
</Scroll>
</div>
<a-divider dashed></a-divider>
<div id="tool-preview">
<div id="tool-preview" v-if="!!bar">
<div id="tool-preview-container">
<div class="tool-preview-item" v-for="item of bar.items">
<component