How to pass html template as props to Vue component

前端 未结 3 2123
时光取名叫无心
时光取名叫无心 2021-01-06 01:28

I have a textarea component that include html tag and I want to get html in edit mode in this component. I use Laravel to

3条回答
  •  甜味超标
    2021-01-06 02:04

    The short answer is NOT POSSIBLE

    Your slot is put inside an textarea tag. Textare tag is only able to display the text content on its box.

    So in the case you want a kind of "HTML edit mode", you may looking for an WYSIWYG editor, I recommend you can use CKEditor for VueJS, the editor even will allow you to direct edit HTML code

    https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/frameworks/vuejs.html

    Your HTML

    Your Component

    const app = new Vue( {
        el: '#app',
        data: {
            editor: ClassicEditor,
            editorData: '

    Editable Content HTML

    ', editorConfig: { // The configuration of the editor. } } } );

提交回复
热议问题