2 Star 3 Fork 0

ORH / vue-markdown-editor

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

Vue markdown editor and marked

npm npm GitHub

demo

Vue 3.x

  1. 安装
$ yarn add @orh/vue-markdown-editor@4
  1. 引入
import { createApp } from 'vue';
import App from './App.vue';
import MarkdownEditor from '@orh/vue-markdown-editor';
import 'simplemde/dist/simplemde.min.css';
import 'highlight.js/styles/<theme>.css';

createApp(App).use(MarkdownEditor).mount('#app')
  1. 使用

示例代码

Vue 2.x

  1. 安装
$ yarn add @orh/vue-markdown-editor@3
  1. 引入
import Vue from 'vue';
import App from './App.vue';
import VueMarkdownEditor from '@orh/vue-markdown-editor';
import '@orh/vue-markdown-editor/dist/css/vue-markdown-editor.css';
import '@orh/vue-markdown-editor/dist/css/themes/<theme>.css';

Vue.use(VueMarkdownEditor);

new Vue({
  el: '#app',
  render: h => h(App)
});

编辑器

<vue-markdown-editor v-model="content"></vue-markdown-editor>

Props

属性 说明 类型 默认值
value markdown 文本,可以使用 v-model 双向绑定数据 String
options 可传入 simplemde-markdown-editor 的所有配置 Object {}
name 表单 textareaname 属性 String -

解析器

<vue-marked :value="content" @rendered="handleRendered"></vue-marked>

Props

属性 说明 类型 默认值
value markdown 文本 String

Events

事件 说明 回调参数
rendered marked 渲染完成后触发 渲染后的 HTML 代码

本地开发/预览

  1. 安装依赖
$ yarn
  1. 运行
$ yarn serve

License

MIT

Repository Comments ( 1 )

Sign in to post a comment

About

Vue markdown editor and marked expand collapse
JavaScript and 3 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
JavaScript
1
https://gitee.com/orh/vue-markdown-editor.git
git@gitee.com:orh/vue-markdown-editor.git
orh
vue-markdown-editor
vue-markdown-editor
4.x

Search