├── .babelrc ├── .gitignore ├── README.md ├── TinyMce.vue ├── index.js └── package.json /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-2"], 3 | "plugins": ["transform-runtime"], 4 | "comments": false, 5 | "env": { 6 | "test": { 7 | "plugins": [ "istanbul" ] 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tinymce-vue-2 2 | A vue 2 component for TinyMCE. 3 | # Install 4 | `npm install tinymce-vue-2` 5 | 6 | # How to use 7 | * Make sure that window.tinymce is present or it will not work 8 | * Then in your code just import it like so : `import TinyMCE from 'tinymce-vue-2';` 9 | * Finally, added to your component as components. If you want it globally available 10 | you can just to this : `Vue.component('tiny-mce', TinyMCE);` 11 | * Check the [examples](#examples) on how to use it in your template 12 | 13 | # Examples 14 | Using the default options, you just need to pass an id and a model 15 | ``` 16 | 17 | ``` 18 | 19 | Check the binding by doing something like `
` anywhere in your 20 | template. 21 | 22 | Check bellow on how to configure and extend the editor. 23 | 24 | ### Changing the menubar 25 | [Read the documentation first](https://www.tinymce.com/docs/configure/editor-appearance/#menubar) 26 | 27 | Pass a prop called menubar which is either a string or a string variable. It can either be 28 | a string or a boolean 29 | 30 | ``` 31 | 35 | ``` 36 | 37 | ### Changing the toolbar 38 | [Read the documentation first](https://www.tinymce.com/docs/configure/editor-appearance/#toolbar) 39 | 40 | Pass a prop called toolbar which is either a string or a string variable 41 | to set the toolbar 42 | ``` 43 | 47 | ``` 48 | 49 | It can also be an array which will set multiple toolbars 50 | ``` 51 | [ 52 | 'undo redo | styleselect | bold italic | link image', 53 | 'alignleft aligncenter alignright' 54 | ] 55 | ``` 56 | 57 | or even a boolean like `false` to disable it 58 | 59 | ### Passing other configuration options 60 | You can pass any of the documented options to the editor using the otherProps property like so 61 | 62 | [Read the documentation first](https://www.tinymce.com/docs/configure/editor-appearance) 63 | 64 | 65 | ``` 66 | 70 | ``` 71 | 72 | This allows you to freely configure the editor since all it does is merging your object 73 | with the `tinymce` one -------------------------------------------------------------------------------- /TinyMce.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 58 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import TinyMce from './TinyMce.vue'; 2 | 3 | export default TinyMce; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tinymce-vue-2", 3 | "version": "0.0.5", 4 | "description": "A vue 2 component for TinyMCE", 5 | "keywords": [ 6 | "vue 2", 7 | "vue component", 8 | "tinymce" 9 | ], 10 | "devDependencies": { 11 | "babel-plugin-transform-runtime": "^6.0.0", 12 | "babel-preset-es2015": "^6.0.0", 13 | "babel-preset-stage-2": "^6.0.0" 14 | }, 15 | "author": "Michael Bouclas (http://net-tomorrow.com/)", 16 | "license": "MIT", 17 | "homepage": "https://github.com/mbouclas/tinymce-vue-2", 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/mbouclas/tinymce-vue-2" 21 | } 22 | } --------------------------------------------------------------------------------