Merge pull request #10 from yanbowe/fix-editor
fix(projects): wangEditor在暗黑模式下的背景色问题
This commit is contained in:
commit
f82a4f0aed
@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<n-card title="富文本插件" class="shadow-sm rounded-16px">
|
<n-card title="富文本插件" class="shadow-sm rounded-16px">
|
||||||
<div ref="domRef"></div>
|
<div ref="domRef" class="dark:bg-dark"></div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<github-link link="https://github.com/wangeditor-team/wangEditor" />
|
<github-link link="https://github.com/wangeditor-team/wangEditor" />
|
||||||
</template>
|
</template>
|
||||||
</n-card>
|
</n-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
@ -19,17 +19,24 @@ const editor = ref<WangEditor | null>(null);
|
|||||||
const domRef = ref<HTMLElement | null>(null);
|
const domRef = ref<HTMLElement | null>(null);
|
||||||
|
|
||||||
function renderWangEditor() {
|
function renderWangEditor() {
|
||||||
editor.value = new WangEditor(domRef.value);
|
editor.value = new WangEditor(domRef.value);
|
||||||
setEditorConfig();
|
setEditorConfig();
|
||||||
editor.value.create();
|
editor.value.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
function setEditorConfig() {
|
function setEditorConfig() {
|
||||||
editor.value!.config.zIndex = 10;
|
editor.value!.config.zIndex = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
renderWangEditor();
|
renderWangEditor();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
:deep(.w-e-text-container) {
|
||||||
|
background: inherit;
|
||||||
|
}
|
||||||
|
:deep(.w-e-toolbar) {
|
||||||
|
background: inherit !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user