refactor: 整理品牌配置与小程序编辑工作区
This commit is contained in:
1 parent
849ae5df05
commit
a2932b1134
13 files changed
+416
-63
No files matched your search
@@ -129,7 +129,11 @@ export function ComponentTemplatePreview({
|
||||
return <Alert type="warning" showIcon message="此模板尚无组件预览,请使用页面预览" />;
|
||||
return (
|
||||
<div className="component-template-preview-shell">
|
||||
<div className="component-template-preview__tools" aria-label="预览操作模式">
|
||||
<div
|
||||
className="component-template-preview__tools"
|
||||
aria-label="预览操作模式"
|
||||
hidden={!targets.length}
|
||||
>
|
||||
<button type="button" aria-pressed={mode === "edit"} onClick={() => setMode("edit")}>
|
||||
点选编辑
|
||||
</button>
|
||||
@@ -144,13 +148,13 @@ export function ComponentTemplatePreview({
|
||||
data-active-record-id={selection?.recordId}
|
||||
data-editor-mode={mode}
|
||||
onPointerMoveCapture={(event) => {
|
||||
if (mode !== "edit") return;
|
||||
if (mode !== "edit" || !targets.length) return;
|
||||
const next = targetFor(event.target instanceof Element ? event.target : null);
|
||||
if (next !== hovered) setHovered(next);
|
||||
}}
|
||||
onPointerLeave={() => setHovered(null)}
|
||||
onClickCapture={(event) => {
|
||||
if (mode !== "edit") return;
|
||||
if (mode !== "edit" || !targets.length) return;
|
||||
const canvas = root.current?.querySelector(".component-template-preview__canvas");
|
||||
if (!event.target || !(event.target instanceof Node) || !canvas?.contains(event.target))
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user