diff --git a/src/components/ai/ExternalAIPanel.vue b/src/components/ai/ExternalAIPanel.vue index ed2761d..915963f 100644 --- a/src/components/ai/ExternalAIPanel.vue +++ b/src/components/ai/ExternalAIPanel.vue @@ -8,13 +8,15 @@ :autosize="{ minRows: 3, maxRows: 8 }" placeholder="粘贴你发给外部 AI 的提示词..." /> -
AI 代码
- +
+
完整的代码
+ +
HTML · {{ splitResult.html.length }} 字符 = { + html: "#fff6f3", + css: "#f3f6ff", + js: "#fffdf0", +} + interface Props { language?: "html" | "css" | "js" fontSize?: number @@ -35,12 +41,22 @@ const lang = computed(() => { if (props.language === "css") return css() return javascript() }) + +const bgTheme = computed(() => { + const bg = bgColors[props.language] ?? "#ffffff" + return EditorView.theme({ + "&": { backgroundColor: bg }, + ".cm-gutters": { backgroundColor: bg }, + }) +}) + +const extensions = computed(() => [styleTheme, bgTheme.value, lang.value])