vue-freemde
What it is
A Vue Markdown Editor for Custom Editing and Rendering
Live Demo: try coding with jsfiddle
install
$ npm i vue-freemde -S
How to use
Import globally
;;; VueconfigproductionTip = false;Vue; /* eslint-disable no-new */ el: '#app' template: '<App/>' components: App ;
Import locally
; name: 'app' components: VueFreemde { return data: '' configs: spellChecker: false autofocus: true toolbar: 'bold' 'italic' 'strikethrough' '|' 'link' 'image' name: 'custom' { const data = markdownvalue this } className: 'fa fa-save' title: 'Save' inlineAttachmentOptions: { // upload to your server, get image url... thissettings } } computed: { return this$refsMarkdowneditor } ;
Use in template
Configs
- markdown: Custom markdown renderer hook. default use
marked
renderer. - view: The rendered callback hook, Used for binding events or element-based rendering.
- inlineAttachmentOptions: Paste Image Parameters.
- onFileReceived: Paste Image Received, param:
file
. - progressText: default
'![uploading file...]()'
- urlText:
'![]({filename})'
. - errorText:
'Error uploading file'
.
- onFileReceived: Paste Image Received, param:
and more configs see: freemde configuration
License
😃 if you have any comments or wish to contribute to this project, you are welcome to submit Issues or PR.
MIT - yansenlei