Giter Club home page Giter Club logo

vue-tinymce-editor's Introduction

vue-tinymce-editor

This a component provides easy use of tinymce for vue developers

Donate Donate

Demo

You can see a demo and an example in this page: Demo & examples

Instalation

$ npm install vue-tinymce-editor

How to use

import Vue from 'vue'
import tinymce from 'vue-tinymce-editor'
Vue.component('tinymce', tinymce)

You may use the component in your markup

<tinymce id="d1" v-model="data"></tinymce>
export default{
    data(){
        return {
            data : ''
        };
    }
}

Properties

Property Type Default Description
id required, String id of component's textarea
toolbar1 String 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat' Toolbar 1 of tinymce
toolbar2 String '' Toolbar 2 of tinymce
plugins Array ['advlist autolink lists link image charmap print preview hr anchor pagebreak', 'searchreplace wordcount visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality','template paste textcolor colorpicker textpattern imagetools toc help emoticons hr codesample'] plugins of tinymce you need to load
other_options Array {} other tinymce options. you can also override our initial options
readonly Boolean false Enables or disables the Editor

Events

Event Parameter Description
editorChange Event This event will be called when tinymce calls onchane
editorInit Editor This event will be called after editor is initialized

Localization

If you wish to use tinymce in other languages, please follow these steps:

  1. Download the language pack you wish to use from here.
  2. Unpack the language file into your desired path, which is accessible from outside and there is a URL pointing to it.
  3. Finally, set language_url in other_options to the URL pointing to the language file.

For example:

export default{
    data(){
        return {
            data : '',
            options: {
                language_url: 'http://example.com/js/langs/fa_IR.js' //This url points to location of persian language file.
            }
        };
    }
}
<tinymce id="d1" v-model="data" :other_options="options"></tinymce>

Direct access to tinymce editor

You can access the tinymce itself by setting a ref to this component:

<tinymce id="d1" v-model="data" ref="tm"></tinymce>

Then you can access the editor by calling:

this.$refs.tm.editor

Donate

If you like this project and it was useful for you don't let it die. Help me continue it. Thank you. Donate or you can buy me a coffee Donate

vue-tinymce-editor's People

Contributors

theroozbeh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.