Gathering detailed insights and metrics for vue-froala-wysiwyg
Gathering detailed insights and metrics for vue-froala-wysiwyg
Gathering detailed insights and metrics for vue-froala-wysiwyg
Gathering detailed insights and metrics for vue-froala-wysiwyg
froala-wysiwyg-vue3
Vue3 plugin for Froala WYSIWYG HTML rich text editor.
@timcharper/vue-froala-wysiwyg
Vue plugin for Froala WYSIWYG HTML rich text editor.
creatint-vue-froala-wysiwyg
Vue plugin for Froala WYSIWYG HTML rich text editor.
vue-froala-wysiwyg-test
Vue plugin for Froala WYSIWYG HTML rich text editor.
npm install vue-froala-wysiwyg
Typescript
Module System
Min. Node Version
Node Version
NPM Version
62.3
Supply Chain
88.9
Quality
82
Maintenance
100
Vulnerability
98.7
License
JavaScript (54.78%)
Shell (29.43%)
Vue (13.97%)
Dockerfile (1.35%)
HTML (0.47%)
Total Downloads
2,578,841
Last Day
1,108
Last Week
9,816
Last Month
54,766
Last Year
769,878
634 Stars
142 Commits
86 Forks
14 Watching
23 Branches
19 Contributors
Minified
Minified + Gzipped
Latest Version
4.3.1
Package Id
vue-froala-wysiwyg@4.3.1
Unpacked Size
1.35 MB
Size
376.24 kB
File Count
12
NPM Version
6.14.18
Node Version
14.21.3
Publised On
18 Nov 2024
Cumulative downloads
Total Downloads
Last day
-54.1%
1,108
Compared to previous day
Last week
-22.2%
9,816
Compared to previous week
Last month
-3.6%
54,766
Compared to previous month
Last year
22%
769,878
Compared to previous year
4
42
vue-froala-wyswiyg provides Vue bindings to the Froala WYSIWYG editor VERSION 3.
Install vue-froala-wysiwyg
from npm
1npm install vue-froala-wysiwyg --save
1//Import Froala Editor 2import 'froala-editor/js/plugins.pkgd.min.js'; 3//Import third party plugins 4import 'froala-editor/js/third_party/embedly.min'; 5import 'froala-editor/js/third_party/font_awesome.min'; 6import 'froala-editor/js/third_party/spell_checker.min'; 7import 'froala-editor/js/third_party/image_tui.min'; 8// Import Froala Editor css files. 9import 'froala-editor/css/froala_editor.pkgd.min.css'; 10import 'froala-editor/css/froala_style.min.css'; 11 12import App from './App' 13import { createApp } from 'vue' 14import VueFroala from 'vue-froala-wysiwyg'; 15 16const app = createApp(App); 17 18app.use(VueFroala); 19app.mount('#app');
1<template> 2 <div id="app"> 3 <froala id="edit" :tag="'textarea'" :config="config" v-model:value="model"></froala> 4 </div> 5</template> 6 7<script> 8 9export default { 10 name: 'App', 11 data () { 12 return { 13 config: { 14 events: { 15 initialized: function () { 16 console.log('initialized') 17 } 18 } 19 }, 20 model: 'Edit Your Content Here!' 21 } 22 } 23} 24</script>
1var webpack = require('webpack') 2var path = require('path') 3 4module.exports = { 5 module: { 6 loaders: [ 7 8 // ... 9 10 // Css loader. 11 { 12 test: /\.css$/, 13 loader: 'cssLoader' 14 } 15 16 ] 17 }, 18 vue: { 19 loaders: { 20 21 // ... 22 23 // Css loader for Webpack 1.x . 24 css: 'cssLoader' 25 } 26 } 27})
1// If model is initialized, 'Init text' text child will be overwritten. 2<froala :tag="'textarea'" :config="config" v-model:value="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.
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:
1config: { 2 placeholderText: 'Edit Your Content Here!', 3 charCounterCount: false 4}
Aditional option is used:
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.
1config: { 2 placeholder: "Edit Me", 3 events : { 4 focus : function(e, editor) { 5 console.log(editor.selection.get()); 6 } 7 } 8}
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.
The WYSIWYG HTML editor content model. Two way binding is suported.
v-model:value="model"
Use the content in other places:
1<input v-model:value="model"/>
You can also use the editor on img, button, input and a tags:
1<froala :tag="img" v-model:value="imgModel"></froala>
The model must be an object containing the attributes for your special tags. Example:
1imgModel: { 2 src: require('./image.jpg') 3}
The model will change as the attributes change during usage.
1buttonModel: { 2 innerHTML: 'Click Me' 3}
As the button text is modified by the editor, the innerHTML attribute from buttonModel model will be modified too.
1config: { 2 vueIgnoreAttrs: ['class', 'id'] 3}
You can pass the custom buttons to the editor by following way:
1<script> 2import FroalaEditor from 'froala-editor'; 3 4FroalaEditor.DefineIcon('alert', {NAME: 'info', SVG_KEY: 'help'}); 5 FroalaEditor.RegisterCommand('alert', { 6 title: 'Hello', 7 focus: false, 8 undo: false, 9 refreshAfterCallback: false, 10 callback: function () { 11 alert('Hello!'); 12 } 13 }); 14 15 FroalaEditor.DefineIcon('clear', {NAME: 'remove', SVG_KEY: 'remove'}); 16 FroalaEditor.RegisterCommand('clear', { 17 title: 'Clear HTML', 18 focus: false, 19 undo: true, 20 refreshAfterCallback: true, 21 callback: function () { 22 this.html.set(''); 23 this.events.focus(); 24 } 25 }); 26 27 FroalaEditor.DefineIcon('insert', {NAME: 'plus', SVG_KEY: 'add'}); 28 FroalaEditor.RegisterCommand('insert', { 29 title: 'Insert HTML', 30 focus: true, 31 undo: true, 32 refreshAfterCallback: true, 33 callback: function () { 34 this.html.insert('My New HTML'); 35 } 36 }); 37 </script> 38
Now you can use these buttons in options:
1toolbarButtons: [['undo', 'redo' , 'bold'], ['alert', 'clear', 'insert']], 2
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"
1initialize: function(initControls) { 2 this.initControls = initControls; 3 this.deleteAll = () => { 4 this.initControls.getEditor().html.set(''); 5 this.initControls.getEditor().undo.reset(); 6 this.initControls.getEditor().undo.saveStep(); 7 }; 8}
The object received by the function will contain the following methods:
To display content created with the froala editor use the froalaView
component.
1<froala v-model:value="content"></froala> 2 3<froalaView v-model:value="content"></froalaView>
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.
If you want to contribute to vue-froala-wyswiyg, you will first need to install the required tools to get the project going.
$ npm install
$ npm run build
$ npm run dev
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
Found 1/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
37 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More