2.1.1 • Published 2 years ago

vue-simplemde v2.1.1

Weekly downloads
4,274
License
MIT
Repository
github
Last release
2 years ago

Vue-SimpleMDE

Markdown Editor component for Vue.js. Support only vue2.x.

npm package npm downloads

Use Setup

No longer support Vue1.x, you can modify to use

Install

npm install vue-simplemde --save

Use

  • Internal reference in a single component
<template>
  <vue-simplemde v-model="content" ref="markdownEditor" />
</template>

<script>
  import VueSimplemde from 'vue-simplemde'

  export default {
    components: {
      VueSimplemde
    }
  }
</script>

<style>
  @import '~simplemde/dist/simplemde.min.css';
</style>
  • Global reference
import Vue from 'vue'
import VueSimplemde from 'vue-simplemde'
import 'simplemde/dist/simplemde.min.css'

Vue.component('vue-simplemde', VueSimplemde)

Props

propertytypedefaultdescribe
valueStringNoneInitial value, v-model binding can be used
nameStringNoneThe name of the control.
preview-classStringNoneCustom preview style class
autoinitBooleantrueAutomatic initialization
highlightBooleanfalseIs it open to highlight
sanitizeBooleanfalseHTML that does not render input after opening
configsObject{}SimpleMDE's config
previewRenderFunction-configs.previewRender

Events

eventdescribearguments
inputTriggered when the Input value changesvalue
blurTriggered when the Input loses focusvalue
initializedTriggered when initialization is completesimplemde

Methods

this.$refs.markdownEditor.simplemde.togglePreview();

Markdown style

e.g. use Github's markdown style

github-markdown-css

install

$ npm install --save github-markdown-css

use

<template>
  <vue-simplemde preview-class="markdown-body" />
</template>

<style>
  @import '~simplemde/dist/simplemde.min.css';
  @import '~github-markdown-css';
</style>

Highlight

install

$ npm install --save highlight.js

use

<template>
  <vue-simplemde :highlight="true" />
</template>

<script>
  import hljs from 'highlight.js';

  window.hljs = hljs;
</script>

<style>
  @import '~simplemde/dist/simplemde.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 (simplemde-theme-base)

e.g. use simplemde-theme-base theme

install

$ npm install --save simplemde-theme-base

use

<style>
  @import '~simplemde-theme-base/dist/simplemde-theme-base.min.css';
  /* no need import simplemde.min.css */
</style>

e.g.

Dark Theme

Screenshot of SimpleMDE Theme Dark

Configuration

SimpleMD's config

Examples

Dependencies

Licence

vue-simplemde is open source and released under the MIT Licence.

Copyright (c) 2022 F-loat

2.1.1

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.0

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.0

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.9

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.0

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago