【问题标题】:Laravel 8.x - Creating copies of a toast markdown editor in laravel bladeLaravel 8.x - 在 laravel Blade 中创建 Toast Markdown 编辑器的副本
【发布时间】:2022-01-26 22:55:40
【问题描述】:

这是一个菜鸟问题。我正在尝试使用以下代码创建 toastui 编辑器的多个副本,但我没有得到所需的输出。请告诉我我在这里做错了什么。

<div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
            @for($i=0;$i<10;$i++)
            <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
            <div class="flex flex-col space-y-2">
    <label for="editor" class="text-gray-600 font-semibold">Content</label>
    <div id="editor" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm"></div>
</div>
            </div>
            @endfor
        </div>
    </div>

【问题讨论】:

    标签: laravel toast-ui-editor


    【解决方案1】:
            @for($i=0;$i<10;$i++)
                <div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
                    <div class="flex flex-col space-y-2">
                        <label for="editor" class="text-gray-600 font-semibold">Content</label>
                        <div id="editor-{{$i}}" class="mt-1 block w-full rounded-md border-gray-300 shadow-sm"></div>
                    </div>
                </div>
            @endfor
    

    在脚本标签中:

     for(let i=0; i<10; i++){
          const editor = new toastui.Editor({
            el: document.querySelector('#editor'+i),
            previewStyle: 'vertical',
            height: '500px',
            initialValue: content
          });
        }
    

    【讨论】:

      猜你喜欢
      • 2021-09-17
      • 2018-02-05
      • 1970-01-01
      • 1970-01-01
      • 2018-07-29
      • 2021-04-08
      • 2018-06-16
      • 2013-07-05
      • 1970-01-01
      相关资源
      最近更新 更多