This file provides documentation for the HugeRTE Vue integration package.
The repo linked above comes with various demos to show various ways of integrating HugeRTE with Vue. To run the demos, follow the following steps:
- Clone the repo:
git clone https://github.com/hugerte/hugerte-vue
- Install dependencies:
yarn
- Run the demos:
yarn demo
Add the HugeRTE Vue component to your project using npm (or an npm-based package manager like yarn):
npm install @hugerte/hugerte-vue
or:
yarn add @hugerte/hugerte-vue
Then, copy the demo that is appropriate for you from the repo linked above. Replace import Editor from "/@/main/ts/index"
by import Editor from '@hugerte/hugerte-vue'
. If your code will contain non-trivial portions of demo code, add the text of the LICENSE.txt file as a comment to your code or on some „Acknowledgements“ page to ensure legal compliance.
- Replace
tinymce
byhugerte
(@tinymce/tinymce-vue
to@hugerte/hugerte-vue
). - Review the changed props in the changelog.
The repo also comes with a storybook. The storybook does not contain as many demos as the demos above, but it does show the basic abilities to use HugeRTE in an iframe, in inline mode, with synchronization between the editor and a textarea containing its HTML content output, and in disabled mode.
cdn-version
: A string representing the version of HugeRTE to be loaded from the jsDelivr CDN. This is only applied if thehugerteScriptSrc
prop is not set. By default, version 1 (that is, the latest minor and patch release of the major version 1) will be used. For more info about the possible version formats, see the jsDelivr documentation.id
: A unique string identifier for the editor instance. If not provided, a unique id will be generated.init
: An object of options to be passed to thehugerte.init()
method.initial-value
: A string representing the initial content to be loaded into the editor. If not provided, the editor will be empty.output-format
: Specifies the format of the editor's output. Can be eitherhtml
ortext
. Default ishtml
.inline
: A boolean indicating if the editor should be rendered inline. Default isfalse
.model-events
: An array or a string specifying the events that should trigger updates to the editor'sv-model
. Default ischange keyup undo redo
.plugins
: An array or a string listing the plugins to be used by the editor. This will be added as theplugins
option of object passed to thehugerte.init()
method.tag-name
: A string specifying the HTML tag to be used for the editor element if rendered in inline mode. Default isdiv
. This is only used ifinline
is set totrue
.toolbar
: An array or a string defining the items to be included in the editor's toolbar. This will be added as thetoolbar
option of object passed to thehugerte.init()
method.disabled
: A boolean indicating whether the editor is disabled. Default isfalse
.hugerte-script-src
: A string URL that specifies the source of the HugeRTE script to be loaded. If this is not specified, the script will be loaded from the jsDelivr CDN.
The HugeRTE Vue component is intended to support Vue 3. If you really need support for Vue 2.x you can open a discussion and I will fork an old version of the TinyMCE Vue component that supports Vue 2.x.
Have you found an issue with hugerte-vue
or do you have a feature request? Open up an issue and let us know or submit a pull request. Note: for issues related to HugeRTE itself please visit the HugeRTE repository.