簡體   English   中英

在primeng的p-editor中添加自定義html源代碼按鈕

[英]add custom html source code button in p-editor of primeng

請舉例說明如何在primeng的p-editor中添加自定義html源代碼編輯按鈕! 因為,它不以默認的 p 編輯器格式提供。 請在這種情況下幫助我。

提前致謝 :)

如果您在“ngOnInit”或構造函數中加載內容,編輯器不會失敗。 但是如果你想動態加載,我認為你必須使用不同的 var 然后替換它

或者

在分配那個 var 之前使用這個函數

escapeHtml(text) {
    if (!text) {
      text = '';
    }
    text += '';
    text = text
      .replace(/&/g, '&')
      .replace(/&lt;/g, '<')
      .replace(/&gt;/g, '>')
      .replace(/&quot;/g, '"')
      .replace(/&#039;/g, '\'');
    return text;
  }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM