wip fix
This commit is contained in:
parent
6cb7d5d8b7
commit
e23c11d198
|
|
@ -159,24 +159,30 @@ export const ScriptMonaco = () => {
|
||||||
openCodeEditor(source, r, selectionOrPosition) {
|
openCodeEditor(source, r, selectionOrPosition) {
|
||||||
const cpath = r.path.substring(`scope~`.length).split("__");
|
const cpath = r.path.substring(`scope~`.length).split("__");
|
||||||
const comp_id = cpath[0];
|
const comp_id = cpath[0];
|
||||||
const path = cpath[1].split("~");
|
if (cpath[1]) {
|
||||||
const type = path[0] as "prop" | "passprop" | "local";
|
const path = cpath[1].split("~");
|
||||||
const id = path[path.length - 1].replace(".d.ts", "");
|
const type = path[0] as "prop" | "passprop" | "local";
|
||||||
|
const id = path[path.length - 1].replace(".d.ts", "");
|
||||||
|
|
||||||
if (comp_id) {
|
if (type === "prop") {
|
||||||
let meta = p.page.meta[id];
|
return false;
|
||||||
if (active.comp_id) {
|
|
||||||
meta = p.comp.list[active.comp_id].meta[id];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meta && meta.item.originalId) {
|
if (comp_id) {
|
||||||
active.item_id = meta.item.originalId;
|
let meta = p.page.meta[id];
|
||||||
|
if (active.comp_id) {
|
||||||
|
meta = p.comp.list[active.comp_id].meta[id];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (meta && meta.item.originalId) {
|
||||||
|
active.item_id = meta.item.originalId;
|
||||||
|
}
|
||||||
|
active.comp_id = comp_id;
|
||||||
|
} else {
|
||||||
|
active.item_id = id;
|
||||||
}
|
}
|
||||||
active.comp_id = comp_id;
|
p.render();
|
||||||
} else {
|
|
||||||
active.item_id = id;
|
|
||||||
}
|
}
|
||||||
p.render();
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ export const declareScope = async (
|
||||||
|
|
||||||
if (!s) return;
|
if (!s) return;
|
||||||
|
|
||||||
|
s.p.push(active_id);
|
||||||
|
|
||||||
monaco.editor.getModels().forEach((model) => {
|
monaco.editor.getModels().forEach((model) => {
|
||||||
if (model.uri.toString().startsWith("ts:scope~")) {
|
if (model.uri.toString().startsWith("ts:scope~")) {
|
||||||
model.dispose();
|
model.dispose();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue