【问题标题】:How to fix Summernote issue in my .Net 5 app?如何在我的 .Net 5 应用程序中修复 Summernote 问题?
【发布时间】:2021-12-17 02:33:12
【问题描述】:

我正在尝试在我的联系表单上为文本区域使用 Summernote,不幸的是,在运行应用程序时,我的联系表单中的 textarea 显示了两次。 这里是 textarea 引导代码:

    <div class="control-group">
        <div class="form-group floating-label-form-group controls">
             <label asp-for="Message">Message</label>
             <textarea rows="5" class="form-control" asp-for="Message" required data-validation-required-message="Please enter a message."></textarea>
             <p class="help-block text-danger"></p>
        </div>
    </div>

@section Scripts{
    <script>
        //Default font size but not for placeholder...
        $('#Message').summernote({
            placeholder: "Please enter a message"
        });
    </script>
}

请注意,我使用的是 "summernote-bs4.min.css" & "summernote-bs4.min.js"

【问题讨论】:

  • 嗨@fyardlest,您能分享更多查看代码吗?我测试了您提供的代码,并且 textarea 只显示一次。另外,你的观点是怎样的?
  • 您好@Rena,感谢您的回答。我想我明白了正在发生的事情。

标签: c# asp.net-mvc summernote


【解决方案1】:

问题在于,对于 Bootstrap 4,我必须使用 popper 脚本才能使其正常工作;

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" ></script> 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-05
    • 1970-01-01
    • 1970-01-01
    • 2017-05-08
    • 1970-01-01
    相关资源
    最近更新 更多