vue-pell-editor
vue-pell-editor
Vue wrapper for pell WYSIWYG text editor
Installation
Install via NPM or Yarn:
$ npm install --save vue-pell-editor
# OR
$ yarn add vue-pell-editor
Usage
main.js:
import Vue from 'vue'
import VuePellEditor from 'vue-pell-editor'
Vue.use(VuePellEditor)
example.vue:
<template>
<vue-pell-editor
v-model="editorContent"
:actions="editorOptions"
:content="editorContent"
:placeholder="editorPlaceholder"
:style-with-css="false"
:classes="editorClasses"
default-paragraph-separator="p"
@change="doSomething"
@mounted="doSomethingAfterMounted"
/>
</template>
<script>
export default {
data: () => ({
editorOptions: [
'bold',
'underline',
{
name: 'italic',
result: () => window.pell.exec('italic')
},
{
name: 'custom',
icon: '<b><u><i>C</i></u></b>',
title: 'Custom Action',
result: () => console.log('YOLO')
},
{
name: 'image',
result: () => {
const url = window.prompt('Enter the image URL')
if (url) window.pell.exec('insertImage', ensureHTTP(url))
}
},
{
name: 'link',
result: () => {
const url = window.prompt('Enter the link URL')
if (url) window.pell.exec('createLink', ensureHTTP(url))
}
}
],
editorPlaceholder: 'Write something amazing...',
editorContent: '<div>Predefined Content</div>',
editorClasses: {
actionbar: 'pell-actionbar',
button: 'pell-button',
content: 'pell-content',
selected: 'pell-button-selected'
}
}),
methods: {
doSomething() {
console.log('Hello')
},
doSomethingAfterMounted() {
console.log('Editor mounted')
}
}
}
</script>
For the pell-editor-options have a look at the pell repository.
License
vue-pell-editor is open source and released under the MIT License.
Copyright (c) 2018 Lars Eichler.
PS: You're a happy user of vue-pell-editor? Let me know via Twitter: @cinkon.
Related Packages
vue-quill-editor-support-insert-table
Quill editor component for Vue; quill use 2.0.0-dev.4 version to support insert...
3,847
7,385
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 2.0.1 | ^2.5.16 | MIT | |
| 2.0.0 | ^2.5.16 | MIT | |
| 1.0.1 | ^2.4.0 | MIT | |
| 1.0.0 | ^2.4.0 | MIT | |
| 0.1.4 | ^2.4.0 | MIT | |
| 0.1.3 | ^2.4.0 | MIT | |
| 0.1.2 | ^2.4.0 | MIT | |
| 0.1.1 | ^2.4.0 | MIT | |
| 0.1.0 | ^2.4.0 | MIT | |
| 0.0.16 | ^2.4.0 | MIT | |
| 0.0.15 | ^2.4.0 | MIT | |
| 0.0.13 | ^2.4.0 | MIT | |
| 0.0.12 | ^2.4.0 | MIT | |
| 0.0.11 | ^2.4.0 | MIT | |
| 0.0.10 | ^2.4.0 | MIT | |
| 0.0.9 | ^2.4.0 | MIT | |
| 0.0.8 | ^2.4.0 | MIT | |
| 0.0.6 | ^2.4.0 | MIT | |
| 0.0.5 | ^2.4.0 | MIT | |
| 0.0.4 | ^2.4.0 | MIT | |
| 0.0.3 | ^2.4.0 | MIT |