Skip to content

Commit

Permalink
fix: show code id first in designer view
Browse files Browse the repository at this point in the history
  • Loading branch information
wwsun committed Mar 13, 2024
1 parent 1d04514 commit b3b68ed
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/designer/src/helpers/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export function getElementData(
const display = getElementCSSDisplay(element);
return {
id: dnd.id,
codeId: dnd.index,
name: dnd.component || element.tagName.toLowerCase(),
filename: dnd.filename,
bounding,
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/src/sidebar/outline-panel/state-tree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const StateTree = observer(() => {
const [, forceUpdate] = useReducer((x) => x + 1, 0);
const tangoContext = pick(sandboxQuery.window['tango'] || {}, [
'stores',
'refs',
'page',
'services',
'config',
]);
Expand Down
2 changes: 1 addition & 1 deletion packages/designer/src/simulator/selection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function SelectionBox({ showActions, actions, data }: SelectionBoxProps) {
label={
<>
<NameSelector
label={data.name}
label={data.codeId || data.name}
parents={data.parents}
onSelect={(item) => {
workspace.selectSource.select(item);
Expand Down
7 changes: 7 additions & 0 deletions packages/helpers/src/types/advanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ export type ElementBoundingType = {
* 选中项数据类型
*/
export interface ISelectedItemData {
/**
* 节点的 data-dnd 值
*/
id?: string;
/**
* 节点的 codeId
*/
codeId?: string;
/**
* 组件名
*/
Expand Down

0 comments on commit b3b68ed

Please sign in to comment.