Gathering detailed insights and metrics for vue-froala-wysiwyg-test
Gathering detailed insights and metrics for vue-froala-wysiwyg-test
Gathering detailed insights and metrics for vue-froala-wysiwyg-test
Gathering detailed insights and metrics for vue-froala-wysiwyg-test
npm install vue-froala-wysiwyg-test
Typescript
Module System
Min. Node Version
Node Version
NPM Version
54.4
Supply Chain
87
Quality
74.5
Maintenance
50
Vulnerability
98.7
License
JavaScript (54.78%)
Shell (29.43%)
Vue (13.97%)
Dockerfile (1.35%)
HTML (0.47%)
Total Downloads
316
Last Day
1
Last Week
2
Last Month
4
Last Year
60
634 Stars
142 Commits
86 Forks
14 Watching
23 Branches
19 Contributors
Latest Version
4.0.5
Package Id
vue-froala-wysiwyg-test@4.0.5
Unpacked Size
944.49 kB
Size
266.81 kB
File Count
12
NPM Version
6.14.15
Node Version
14.17.6
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
100%
2
Compared to previous week
Last month
33.3%
4
Compared to previous month
Last year
-13%
60
Compared to previous year
4
42
vue-froala-wyswiyg provides Vue bindings to the Froala WYSIWYG editor VERSION 3.
@legacy
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'; 10 11// Import and use Vue Froala lib. 12import VueFroala from 'vue-froala-wysiwyg' 13Vue.use(VueFroala) 14Vue.config.productionTip = false 15 16new Vue({ 17 render: h => h(App), 18 19}).$mount('#app') 20
1<template> 2 <div id="app"> 3 <froala id="edit" :tag="'textarea'" :config="config" v-model="model"></froala> 4 </div> 5</template> 6 7<script> 8import VueFroala from 'vue-froala-wysiwyg'; 9 10export default { 11 name: 'app', 12 data () { 13 return { 14 config: { 15 events: { 16 initialized: function () { 17 console.log('initialized') 18 } 19 } 20 }, 21 model: 'Edit Your Content Here!' 22 } 23 } 24} 25</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: 'vue-style-loader!css-loader' 14 } 15 16 ] 17 }, 18 vue: { 19 loaders: { 20 21 // ... 22 23 // Css loader for Webpack 1.x . 24 css: 'vue-style-loader!css-loader' 25 } 26 } 27})
1// If model is initialized, 'Init text' text child will be overwritten. 2<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.
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="model"
Use the content in other places:
1<input v-model="model"/>
You can also use the editor on img, button, input and a tags:
1<froala :tag="img" v-model="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="content"></froala> 2 3<froalaView v-model="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