Markdown Editor component for Vue.js. Support only vue2.x.
Vue1.x is not supported
npm install vue-inscrybmde --save
- Internal reference in a single component
<template>
<markdown-editor v-model="content" ref="markdownEditor"></markdown-editor>
</template>
<script>
import markdownEditor from "vue-inscrybmde/src/markdown-editor";
export default {
components: {
markdownEditor
}
};
</script>
<style>
@import "~inscrybmde/dist/inscrybmde.min.css";
</style>
- Global reference
import Vue from "vue";
import VueSimplemde from "vue-inscrybmde";
import "inscrybmde/dist/inscrybmde.min.css";
Vue.use(VueSimplemde);
property | type | default | describe |
---|---|---|---|
value | String | None | Initial value, v-model binding can be used |
name | String | None | The name of the control. |
preview-class | String | None | Custom preview style class |
autoinit | Boolean | true | Automatic initialization |
highlight | Boolean | false | Is it open to highlight |
sanitize | Boolean | false | HTML that does not render input after opening |
configs | Object | {} | SimpleMDE's config |
e.g. use Github's markdown style
$ npm install --save github-markdown-css
<template>
<markdown-editor preview-class="markdown-body"></markdown-editor>
</template>
<style>
@import "~inscrybmde/dist/inscrybmde.min.css";
@import "~github-markdown-css";
</style>
$ npm install --save highlight.js
<template>
<markdown-editor :highlight="true"></markdown-editor>
</template>
<script>
import hljs from "highlight.js";
window.hljs = hljs;
</script>
<style>
@import "~inscrybmde/dist/inscrybmde.min.css";
@import "~highlight.js/styles/atom-one-dark.css";
/* Highlight theme list: https://github.com/isagalaev/highlight.js/tree/master/src/styles */
</style>
Editor Theme (inscrybmde-theme-base)
e.g. use inscrybmde-theme-base theme
$ npm install --save inscrybmde-theme-base
<style>
@import "~inscrybmde-theme-base/dist/inscrybmde-theme-base.min.css";
/* no need import inscrybmde.min.css */
</style>
Configuration is based on InscrybMDE config
vue-inscrybmde is open source and released under the MIT Licence.
Copyright (c) 2019 Dan Trevino