как использовать лицензионный ключ в реагировать на следующие со следующими - PullRequest
0 голосов
/ 04 марта 2019

Я использую "react-froala-wysiwyg": "^2.9.1-1" с "next": "^7.0.2" версией.

Я приобрел лицензию и создал лицензионный ключ, используя домен.но я не знаю, как его использовать.

Я пробовал метод froala в componentDidMount, но он не работает.

componentDidMount() {
    $('.fr-box').froalaEditor({
      key: config.froalaLicense
    });
  }

render() {
 return (
     <FroalaEditor
        tag='textarea'
        model={content}
        onModelChange={handleChangeForContent}
        config={{
          placeholder: "Edit Me",
          charCounterCount: false,
          events: {
            'froalaEditor.image.beforeUpload': (e, editor, images) => {
              setTargetImage(images[0])
            },
            'froalaEditor.image.inserted': (e, editor, response) => {
              uploadImageForEditor(response[0])
            }
          }
        }}
      />
 )
}

Этот код взят из документа froala.научите меня, как убрать уведомление, Unlicensed copy of the Froala Editor. Use it legally by purchasing a license.

1 Ответ

0 голосов
/ 10 марта 2019

Вам нужен пароль, как в объекте конфигурации.

componentDidMount() {
    $('.fr-box').froalaEditor({
      key: config.froalaLicense
    });
  }

render() {
 return (
     <FroalaEditor
        tag='textarea'
        model={content}
        onModelChange={handleChangeForContent}
        config={{
          key: "YOUR_KEY", // Pass your key here
          placeholder: "Edit Me",
          charCounterCount: false,
          events: {
            'froalaEditor.image.beforeUpload': (e, editor, images) => {
              setTargetImage(images[0])
            },
            'froalaEditor.image.inserted': (e, editor, response) => {
              uploadImageForEditor(response[0])
            }
          }
        }}
      />
 )
}
...