# vue-simplemde

> SimpleMDE - Markdown Editor component for Vue.js

Latest version **2.1.1** (published 2022-06-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-simplemde
pnpm add vue-simplemde
yarn add vue-simplemde
bun add vue-simplemde
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2022-06-01 |
| First published | 2017-01-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 140.2 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 765 |
| Author | F-loat |
| Maintainers | f-loat |
| Keywords | Vue, SimpleMDE, Markdown |

## Links

- npm: https://www.npmjs.com/package/vue-simplemde
- Repository: https://github.com/F-loat/vue-simplemde
- Homepage: https://github.com/F-loat/vue-simplemde#readme
- Issues: https://github.com/F-loat/vue-simplemde/issues
- npm.io page: https://npm.io/package/vue-simplemde

## Dependencies (2)

- [marked](https://npm.io/package/marked.md) ^3.0.8
- [simplemde](https://npm.io/package/simplemde.md) *

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 2.1.1 (latest) — 2022-06-01
- 2.1.0 — 2022-06-01
- 2.0.1 — 2022-01-11
- 2.0.0 — 2021-01-17
- 1.1.2 — 2020-07-20
- 1.1.1 — 2020-07-13
- 1.1.0 — 2020-07-13
- 1.0.7 — 2020-07-13
- 1.0.6 — 2020-05-19
- 1.0.5 — 2020-05-12
- 1.0.4 — 2019-12-28
- 1.0.3 — 2019-12-02
- 1.0.2 — 2019-12-02
- 1.0.0 — 2019-07-11
- 0.5.2 — 2019-05-23
- … 27 more at https://npm.io/package/vue-simplemde/versions

## README

# Vue-SimpleMDE
> Markdown Editor component for Vue.js. Support only vue2.x.

[![npm package](https://img.shields.io/npm/v/vue-simplemde.svg)](https://npmjs.org/package/vue-simplemde)
[![npm downloads](http://img.shields.io/npm/dm/vue-simplemde.svg)](https://npmjs.org/package/vue-simplemde)

# Use Setup

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

## Install

``` bash
npm install vue-simplemde --save
```

## Use

* Internal reference in a single component

``` vue
<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

``` javascript
import Vue from 'vue'
import VueSimplemde from 'vue-simplemde'
import 'simplemde/dist/simplemde.min.css'

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

## Props
| 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](#configuration) |
| previewRender | Function | - | configs.previewRender |

## Events

| event | describe | arguments |
| ----| ----- | ---- |
| input | Triggered when the Input value changes | value |
| blur | Triggered when the Input loses focus | value |
| initialized | Triggered when initialization is complete | simplemde |

## Methods

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

* [examples/index.vue](./examples/index.vue)

* [simplemde.js](https://github.com/sparksuite/simplemde-markdown-editor/blob/6abda7ab68cc20f4aca870eb243747951b90ab04/src/js/simplemde.js#L1908-L2026)

## Markdown style
> e.g. use Github's markdown style

[github-markdown-css](https://github.com/sindresorhus/github-markdown-css)

### install
``` bash
$ npm install --save github-markdown-css
```

### use
``` vue
<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
``` vue
<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](https://github.com/xcatliu/simplemde-theme-base/wiki/List-of-themes))
> e.g. use simplemde-theme-base theme

### install
```
$ npm install --save simplemde-theme-base
```

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

### e.g.

[Dark Theme](https://github.com/xcatliu/simplemde-theme-dark)

![Screenshot of SimpleMDE Theme Dark](https://github.com/xcatliu/simplemde-theme-dark/raw/master/docs/screenshot.png)

## Configuration
> SimpleMD's config

* [中文](doc/configuration_zh.md)
* [English](doc/configuration_en.md)

## Examples

* [Simple Example](./examples/index.vue)
* [Nuxt Example](./examples/nuxt)
* [Demo Page](https://f-loat.github.io/vue-simplemde/)
* [Demo Source](https://github.com/F-loat/vue-simplemde/tree/gh-pages)

## Dependencies

* [SimpleMDE](https://github.com/sparksuite/simplemde-markdown-editor)

## Licence

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

Copyright (c) 2022 F-loat

---
_Source: https://npm.io/package/vue-simplemde · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
