All Projects → froala → Vue Froala Wysiwyg

froala / Vue Froala Wysiwyg

Vue component for Froala WYSIWYG HTML Rich Text Editor.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Froala Wysiwyg

Ckeditor5
Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
Stars: ✭ 5,406 (+877.58%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Simditor
An Easy and Fast WYSIWYG Editor
Stars: ✭ 4,926 (+790.78%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Text
📑 Collaborative document editing using Markdown
Stars: ✭ 282 (-49.01%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Wysiwyg Editor
The next generation Javascript WYSIWYG HTML Editor.
Stars: ✭ 4,756 (+760.04%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Element Tiptap
🌸A modern WYSIWYG rich-text editor using tiptap and Element UI for Vue.js
Stars: ✭ 481 (-13.02%)
Mutual labels:  rich-text-editor, wysiwyg-editor
rtexteditorview
A simple WYSIWYG editor for Android
Stars: ✭ 51 (-90.78%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Trumbowyg
A lightweight and amazing WYSIWYG JavaScript editor under 10kB
Stars: ✭ 3,664 (+562.57%)
Mutual labels:  rich-text-editor, wysiwyg-editor
wysiwyg-editor-php-sdk
PHP SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 37 (-93.31%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Awesome Web Editor
🔨 Open source WEB editor summary
Stars: ✭ 306 (-44.67%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Angular Froala
Angular.js bindings for Froala WYSIWYG HTML Rich Text Editor.
Stars: ✭ 299 (-45.93%)
Mutual labels:  rich-text-editor, wysiwyg-editor
typester
✒️ A WYSIWYG that gives you predictable and clean HTML
Stars: ✭ 29 (-94.76%)
Mutual labels:  rich-text-editor, wysiwyg-editor
React Quill
A Quill component for React.
Stars: ✭ 4,739 (+756.96%)
Mutual labels:  rich-text-editor, wysiwyg-editor
textbus
Textbus 是一个组件化的、数据驱动的富文本框架,支持在线协同编辑,同时也可以作为一个开箱即用的富文本编辑器,拥有非常好的扩展性和可定制性,是构建复杂富文本的不二之选!
Stars: ✭ 642 (+16.09%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Slate Plugins
🔌 Next-gen slate plugins
Stars: ✭ 399 (-27.85%)
Mutual labels:  rich-text-editor, wysiwyg-editor
wysiwyg-editor-dotnet-sdk
.NET SDK to ease the integration of Froala WYSIWYG Editor on server side.
Stars: ✭ 23 (-95.84%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Re Editor
一个开箱即用的React富文本编辑器 🚀re-editor
Stars: ✭ 367 (-33.63%)
Mutual labels:  rich-text-editor, wysiwyg-editor
wordpress-froala-wysiwyg
Wordpress plugin for Froala WYSIWYG HTML Editor.
Stars: ✭ 38 (-93.13%)
Mutual labels:  rich-text-editor, wysiwyg-editor
am-editor
A rich text collaborative editor framework that can use React and Vue custom plug-ins. 一个富文本实时协同编辑器框架,可以使用React和Vue自定义插件。
Stars: ✭ 542 (-1.99%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Trix
A rich text editor for everyday writing
Stars: ✭ 16,546 (+2892.04%)
Mutual labels:  rich-text-editor, wysiwyg-editor
Wysiwyg.js
wysiwyg contenteditable editor (minified+compression: 6kb)
Stars: ✭ 520 (-5.97%)
Mutual labels:  rich-text-editor, wysiwyg-editor

Vue JS Froala WYSIWYG Editor

npm npm npm

vue-froala-wyswiyg provides Vue bindings to the Froala WYSIWYG editor VERSION 3.

Compatibility

  • v1 later @legacy
    • Vue.js 1.x
  • v2 later
    • Vue.js 2.x

Installation

Install vue-froala-wysiwyg from npm

npm install vue-froala-wysiwyg --save

Integration

1. Require and use Froala Editor component inside your application.

main.js file:

//Import Froala Editor 
import 'froala-editor/js/plugins.pkgd.min.js';
//Import third party plugins
import 'froala-editor/js/third_party/embedly.min';
import 'froala-editor/js/third_party/font_awesome.min';
import 'froala-editor/js/third_party/spell_checker.min';
import 'froala-editor/js/third_party/image_tui.min';
// Import Froala Editor css files.
import 'froala-editor/css/froala_editor.pkgd.min.css';

// Import and use Vue Froala lib.
import VueFroala from 'vue-froala-wysiwyg'
Vue.use(VueFroala)
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  
}).$mount('#app')

App.vue file:

<template>
  <div id="app">
    <froala id="edit" :tag="'textarea'" :config="config" v-model="model"></froala>
  </div>
</template>

<script>
import VueFroala from 'vue-froala-wysiwyg';

export default {
  name: 'app',
  data () {
    return {
      config: {
        events: {
          initialized: function () {
            console.log('initialized')
          }
        }
      },
      model: 'Edit Your Content Here!'
    }
  }
}
</script>

2. Make sure you have the right Webpack settings for loading the CSS files.

var webpack = require('webpack')
var path = require('path')

module.exports = {
  module: {
    loaders: [

      // ...

      // Css loader.
      {
        test: /\.css$/,
        loader: 'vue-style-loader!css-loader'
      }

    ]
  },
  vue: {
    loaders: {

      // ...

      // Css loader for Webpack 1.x .
      css: 'vue-style-loader!css-loader'
    }
  }
})

Usage

Initialize

// If model is initialized, 'Init text' text child will be overwritten.
<froala :tag="'textarea'" :config="config" v-model="model">Init text</froala>

:tag attr is used to tell on which tag the editor is initialized.

There are special tags: a, button, img, input.

Options

You can pass editor options as component attribute (optional).

:config="config"

You can pass any existing Froala option. Consult the Froala documentation to view the list of all the available options:

config: {
  placeholderText: 'Edit Your Content Here!',
  charCounterCount: false
}

Aditional option is used:

  • immediateVueModelUpdate: (default: false) This option updates the Vue model as soon as a key is released in the editor. Note that it may affect performances.

Events and Methods

Events can be passed in with the options, with a key events and object where the key is the event name and the value is the callback function.

config: {
  placeholder: "Edit Me",
  events : {
    focus : function(e, editor) {
      console.log(editor.selection.get());
    }
  }
}

Using the editor instance from the arguments of the callback you can call editor methods as described in the method docs.

Froala events are described in the events docs.

Model

The WYSIWYG HTML editor content model. Two way binding is suported.

v-model="model"

Use the content in other places:

<input v-model="model"/>

Special tags

You can also use the editor on img, button, input and a tags:

<froala :tag="img" v-model="imgModel"></froala>

The model must be an object containing the attributes for your special tags. Example:

imgModel: {
  src: require('./image.jpg')
}

The model will change as the attributes change during usage.

  • The model can contain a special attribute named innerHTML which inserts innerHTML in the element: If you are using 'button' tag, you can specify the button text like this:
buttonModel: {
  innerHTML: 'Click Me'
}

As the button text is modified by the editor, the innerHTML attribute from buttonModel model will be modified too.

Specific option for special tags

  • vueIgnoreAttrs: (default: null) This option is an array of attributes that you want to ignore when the editor updates the v-model:
config: {
 vueIgnoreAttrs: ['class', 'id']
}

Custom Buttons

You can pass the custom buttons to the editor by following way:

App.vue file:

<script>
import FroalaEditor from 'froala-editor';

FroalaEditor.DefineIcon('alert', {NAME: 'info', SVG_KEY: 'help'});
  FroalaEditor.RegisterCommand('alert', {
    title: 'Hello',
    focus: false,
    undo: false,
    refreshAfterCallback: false,
    callback: function () {
      alert('Hello!');
    }
  });

  FroalaEditor.DefineIcon('clear', {NAME: 'remove', SVG_KEY: 'remove'});
  FroalaEditor.RegisterCommand('clear', {
    title: 'Clear HTML',
    focus: false,
    undo: true,
    refreshAfterCallback: true,
    callback: function () {
      this.html.set('');
      this.events.focus();
    }
  });

  FroalaEditor.DefineIcon('insert', {NAME: 'plus', SVG_KEY: 'add'});
  FroalaEditor.RegisterCommand('insert', {
    title: 'Insert HTML',
    focus: true,
    undo: true,
    refreshAfterCallback: true,
    callback: function () {
      this.html.insert('My New HTML');
    }
  });
  </script>
  

Now you can use these buttons in options:

toolbarButtons: [['undo', 'redo' , 'bold'], ['alert', 'clear', 'insert']],

Manual Instantiation

Gets the functionality to operate on the editor: create, destroy and get editor instance. Use it if you want to manually initialize the editor.

:onManualControllerReady="initialize"

initialize: function(initControls) {
  this.initControls = initControls;
  this.deleteAll = () => {
      this.initControls.getEditor().html.set('');
      this.initControls.getEditor().undo.reset();
      this.initControls.getEditor().undo.saveStep();
  };
}

The object received by the function will contain the following methods:

  • initialize: Call this method to initialize the Froala Editor
  • destroy: Call this method to destroy the Froala Editor
  • getEditor: Call this method to retrieve the editor that was created. This method will return null if the editor was not yet created

Displaying HTML

To display content created with the froala editor use the froalaView component.

<froala v-model="content"></froala>

<froalaView v-model="content"></froalaView>

License

The vue-froala-wyswiyg project is under MIT license. However, in order to use Froala WYSIWYG HTML Editor plugin you should purchase a license for it.

Froala Editor has 3 different licenses for commercial use. For details please see License Agreement.

Development environment setup

If you want to contribute to vue-froala-wyswiyg, you will first need to install the required tools to get the project going.

Prerequisites

Install dependencies

$ npm install

Build

$ npm run build

Run Demo

$ npm run dev
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].