mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
chore: 插件编辑与运行测试beta
This commit is contained in:
@@ -26,7 +26,6 @@ export function registerWorker(name: string, worker: any) {
|
||||
window.MonacoEnvironment = {
|
||||
//@ts-ignore
|
||||
getWorker(_, label) {
|
||||
debugger;
|
||||
const custom = WorkerBucket[label];
|
||||
if (custom) {
|
||||
return new custom();
|
||||
|
||||
@@ -83,17 +83,6 @@ const emitValue = lodashDebounce((value: any) => {
|
||||
emits("update:modelValue", value);
|
||||
}, props.debounce || 500);
|
||||
|
||||
// watch(
|
||||
// () => {
|
||||
// return props.modelValue;
|
||||
// },
|
||||
// (value: string) => {
|
||||
// if (instanceRef.value && value !== instanceRef.value.getValue()) {
|
||||
// // instanceRef.value.setValue(value);
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
|
||||
async function createEditor(ctx: EditorCodeCtx) {
|
||||
disposeEditor();
|
||||
const instance = monaco.editor.create(monacoRef.value, {
|
||||
@@ -121,6 +110,9 @@ async function createEditor(ctx: EditorCodeCtx) {
|
||||
instanceRef = instance;
|
||||
ctx.instance = instance;
|
||||
emits("ready", ctx);
|
||||
if (props.modelValue) {
|
||||
instanceRef.setValue(props.modelValue);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -224,6 +216,9 @@ watch(
|
||||
editor.setValue(newValue);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ export async function initWorkers() {
|
||||
} else if (label === "typescript" || label === "javascript") {
|
||||
return new tsWorker.default();
|
||||
} else if (label === "yaml" || label === "yml") {
|
||||
debugger;
|
||||
//@ts-ignore
|
||||
return new yamlWorker.default();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user