fix: correct some typos

This commit is contained in:
xzdry 2022-02-07 15:54:30 +08:00
parent c7142b53e8
commit aba1265b00
3 changed files with 10 additions and 11 deletions

View File

@ -7,7 +7,7 @@ import { ComponentWrapperType } from '@sunmao-ui/runtime';
import { genOperation } from '../operations';
import { EditorServices } from '../types';
import { ExploreMenuTabs } from '../services/enum';
import { ExplorerMenuTabs } from '../services/enum';
type ComponentEditorState = 'drag' | 'select' | 'hover' | 'idle';
@ -126,7 +126,7 @@ export function useComponentWrapper(services: EditorServices): ComponentWrapperT
setHoverComponentId,
dragOverComponentId,
setDragOverComponentId,
setExploreMenuTab,
setExplorerMenuTab,
} = editorStore;
const [slots, isDroppable] = useMemo(() => {
@ -224,7 +224,7 @@ export function useComponentWrapper(services: EditorServices): ComponentWrapperT
e.preventDefault();
setDragOverComponentId('');
setCurrentSlot(undefined);
setExploreMenuTab(ExploreMenuTabs.UI_TREE);
setExplorerMenuTab(ExplorerMenuTabs.UI_TREE);
const creatingComponent = e.dataTransfer?.getData('component') || '';
eventBus.send(
'operation',

View File

@ -6,7 +6,7 @@ import { EventBusType } from './eventBus';
import { AppStorage } from './AppStorage';
import { SchemaValidator } from '../validator';
import { removeModuleId } from '../utils/addModuleId';
import { ExploreMenuTabs, ToolMenuTabs } from './enum';
import { ExplorerMenuTabs, ToolMenuTabs } from './enum';
type EditingTarget = {
kind: 'app' | 'module';
@ -20,7 +20,7 @@ export class EditorStore {
_selectedComponentId = '';
_hoverComponentId = '';
_dragOverComponentId = '';
exploreMenuTab = ExploreMenuTabs.EXPLORE;
explorerMenuTab = ExplorerMenuTabs.EXPLORER;
toolMenuTab = ToolMenuTabs.INSERT;
// current editor editing target(app or module)
currentEditingTarget: EditingTarget = {
@ -190,8 +190,8 @@ export class EditorStore {
this.lastSavedComponentsVersion = val;
};
setExploreMenuTab = (val: ExploreMenuTabs) => {
this.exploreMenuTab = val;
setExplorerMenuTab = (val: ExplorerMenuTabs) => {
this.explorerMenuTab = val;
}
setToolMenuTab = (val: ToolMenuTabs) => {

View File

@ -1,6 +1,5 @@
/* eslint-disable no-unused-vars */
enum ExploreMenuTabs {
EXPLORE = 0,
enum ExplorerMenuTabs {
EXPLORER = 0,
UI_TREE = 1,
STATE = 2
}
@ -10,4 +9,4 @@ enum ToolMenuTabs {
INSERT = 1
}
export { ExploreMenuTabs, ToolMenuTabs };
export { ExplorerMenuTabs, ToolMenuTabs };