Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel CKEditor 5-为什么h2标记看起来像p标记?_Laravel_Vuejs2_Ckeditor_Wysiwyg_Rich Text Editor - Fatal编程技术网

Laravel CKEditor 5-为什么h2标记看起来像p标记?

Laravel CKEditor 5-为什么h2标记看起来像p标记?,laravel,vuejs2,ckeditor,wysiwyg,rich-text-editor,Laravel,Vuejs2,Ckeditor,Wysiwyg,Rich Text Editor,我在为我的项目(VILT堆栈)使用CKEditor 5时遇到问题。 我可以将问题描述如下: 这是我的vue文件: <template> <app-layout> <ckeditor :editor="editor" @blur="onEditorInput" v-model="editorData" :config="editorConfig"></

我在为我的项目(VILT堆栈)使用CKEditor 5时遇到问题。

我可以将问题描述如下:

这是我的vue文件:

<template>
    <app-layout>
        <ckeditor :editor="editor" @blur="onEditorInput" v-model="editorData" :config="editorConfig"></ckeditor>
    </app-layout>
</template>

<script>
    import AppLayout from '@/Layouts/AppLayout'
    import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

    export default {
        components: {
            AppLayout,
        },
        data() { 
            return {
                editor: ClassicEditor,
                editorData: '',
                editorConfig: {
                    // The configuration of the editor.
                }
            }
        },
        methods: {
            onEditorInput() {
                console.log(this.editorData);
            }
        }
    }
</script>
下面是package.json文件的内容:

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@inertiajs/inertia": "^0.8.2",
        "@inertiajs/inertia-vue": "^0.5.4",
        "@tailwindcss/forms": "^0.2.1",
        "@tailwindcss/typography": "^0.3.0",
        "autoprefixer": "^10.0.2",
        "axios": "^0.21",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "portal-vue": "^2.1.7",
        "postcss": "^8.1.14",
        "postcss-import": "^12.0.1",
        "tailwindcss": "^2.0.1",
        "vue": "^2.5.17",
        "vue-loader": "^15.9.6",
        "vue-template-compiler": "^2.6.10"
    },
    "dependencies": {
        "@ckeditor/ckeditor5-build-classic": "^25.0.0",
        "@ckeditor/ckeditor5-vue2": "^1.0.5"
    }
}
你可以看到控制台上写着h2,但它看起来像一个p标签,我不喜欢它,当我选择h2选项时,如何使文本看起来像h2?
我已经试着阅读了,但仍然没有找到正确的解决方案,这是因为您使用的是tailwindcss,它逃避了H标记。你可以加上

@layer 
     base {
  h1 {
    @apply text-2xl;
  }
  h2 {
    @apply text-xl;
  }
}
添加到您的资源->css->app.css文件,您将使其正常工作

@layer 
     base {
  h1 {
    @apply text-2xl;
  }
  h2 {
    @apply text-xl;
  }
}