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