luobisheng
2022-11-16 13e9ddabf4ba3a89aa2a93fe8d3b35c8604c6813
src/components/edit/index.vue
@@ -11,6 +11,7 @@
            editor: null
        }
    },
    props:['getMyBody'],
    mounted() {
        this.editor = new E('#edit');
        this.editor.config.height = 450;
@@ -18,7 +19,12 @@
            '#4b9bb7',
            '#09152f'
        ]
        this.editor.create();
        this.editor.config.onchange = (html)=>{
            // 第二步,监控变化,同步更新到 textarea
            this.$emit('getMyBody', html);
        }
      this.editor.create();
    },
    beforeDestroy() {
        this.editor.destroy();
@@ -28,14 +34,15 @@
}
</script>
<style lang="scss" scoped>
    #edit{
        :deep(.w-e-toolbar){
            background-color: #09152f !important;
            color: #4b9bb7;
        }
        :deep(.w-e-text-container){
            background-color: #09152f !important;
            color: #4b9bb7;
        }
#edit {
    :deep(.w-e-toolbar) {
        background-color: #09152f !important;
        color: #4b9bb7;
    }
    :deep(.w-e-text-container) {
        background-color: #09152f !important;
        color: #4b9bb7;
    }
}
</style>