2.0.1 • Published 6 years ago

vue-pell-editor v2.0.1

Weekly downloads
426
License
MIT
Repository
github
Last release
6 years ago

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.

2.0.1

6 years ago

2.0.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago