• Stars
    star
    768
  • Rank 59,159 (Top 2 %)
  • Language Vue
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📝 Vue SimpleMDE - use simplemde with vue.js

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

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
forceSync Boolean true Sync value to simplemde each time
highlight Boolean false Is it open to highlight
sanitize Boolean false HTML that does not render input after opening
configs Object {} SimpleMDE's config
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

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

More Repositories

1

ithome-lite

🥛 IT之家第三方小程序版客户端(使用 mpvue 开发,兼容 web)
Vue
528
star
2

mpvue-entry

⛓️ 集中式页面配置,统一构建入口,支持新增页面热更新
JavaScript
353
star
3

mpvue-router-patch

🛴在 mpvue 中使用 vue-router 兼容的路由写法
JavaScript
300
star
4

caption2text

📥 PWA 版字幕转换为文本工具,支持 ass 及 srt 格式,可批量导出为 word 及 text 文件
Vue
186
star
5

vue-cli-plugin-qiankun

🚀 qiankun plugin for vue-cli
JavaScript
169
star
6

ChineseBQB-client

🤣 开源表情包小程序
Less
90
star
7

html-i18n-cli

HTML 国际化/翻译 工具
JavaScript
32
star
8

offscreen-canvas-demo

JavaScript
19
star
9

mpvue-packager

🛠 集成构建工具,双端支持
JavaScript
15
star
10

xiaoplayer

xiaomusic 小程序客户端,开源小程序音乐播放器,使用小爱音箱播放本地/NAS音乐
TypeScript
13
star
11

mpvue-config-loader

🏷 单文件页面配置,支持全局组件引用
JavaScript
11
star
12

ncform-maker

🔀 ncform-maker, a very nice visualization way to make ncform schema
JavaScript
7
star
13

unique

🕯 An online shopping platform based on Express & Vue2.
JavaScript
7
star
14

anonchat

👥 基于 web socket 的匿名匹配聊天
Vue
6
star
15

vscode-plugin-ncform-schema

😘 ncform schema editor plugin for vscode
Vue
6
star
16

taobao-edu-spider

🕷淘宝教育视频爬虫,基于Nightmare
JavaScript
5
star
17

vscode-plugin-html-i18n

TypeScript
5
star
18

vue-superagent

⚡A small wrapper for integrating superagent to Vuejs
JavaScript
5
star
19

vod-server

🕯 vod server side
JavaScript
4
star
20

axios-apicloud-adapter

📱 axios 的 apicloud 适配器,以便于在 app 中使用原生网络请求库,避免跨域问题
JavaScript
4
star
21

jsonl-converter

One-Click JSON Lines Converter
TypeScript
3
star
22

cards-ahoy

Cards Ahoy! 小账本,提供实时卡牌价格查询、卡牌盈亏统计及卡组配置分享等功能
TypeScript
2
star
23

vscode-extension-mammoth

Word preview and export extension for vscode.
TypeScript
2
star
24

vod-client

🕯 vod client side
Vue
2
star
25

puppet-spider

🕷 赶集网 Puppeteer 命令行爬虫工具
JavaScript
2
star
26

CasualPlay

✨Some of my small projects
JavaScript
1
star
27

simple-form-binder

JavaScript
1
star
28

university-rankings

油猴脚本,划词查询大学排名
JavaScript
1
star
29

ncform-theme-iview

ncform theme widgets -> iview
Vue
1
star