vue-md-editor

所属分类:图标/字体
开发工具:Vue
文件大小:10KB
下载次数:0
上传日期:2022-01-15 02:19:03
上 传 者sh-1993
说明:  基于Bootstrap和Font Awesome为Vue制作的基本标记编辑器
(Basic markdown editor made for Vue, based on Bootstrap and Font Awesome)

文件列表:
.idea (0, 2020-04-21)
.idea\misc.xml (174, 2020-04-21)
.idea\modules.xml (278, 2020-04-21)
.idea\vcs.xml (180, 2020-04-21)
.idea\vue-md-editor.iml (281, 2020-04-21)
LICENSE (1048, 2020-04-21)
package-lock.json (367, 2020-04-21)
package.json (609, 2020-04-21)
src (0, 2020-04-21)
src\editor.vue (6265, 2020-04-21)
src\helpers (0, 2020-04-21)
src\helpers\helpers.js (956, 2020-04-21)
src\helpers\toolbar.js (1860, 2020-04-21)
src\index.js (131, 2020-04-21)

# Vue markdown editor This is a basic markdown editor made for Vue, based on Bootstrap and Font Awesome. ## Example You can find a example on [Codesandbox](https://codesandbox.io/s/github/mrdaano/vue-md-editor-example) or on [GitHub](https://github.com/mrdaano/vue-md-editor-example) ## Pre requirements - Install [Font Awesome](https://fontawesome.com/) for the toolbar icons. - If you want you can install [Bootstrap](https://getbootstrap.com/) or do the styling by yourself. ## Installation First install this package via npm or yarn: ``` npm i vue-simple-md-editor or yarn install vue-simple-md-editor ``` And then simply add in your Vue setup script: ```javascript import mdEditor from 'vue-md-editor'; import Vue from 'vue'; Vue.use(mdEditor); ``` ## Usage and examples Now you can use the markdown editor in your Vue container or components. You can use it with or without ``v-model``. ### Basic usage ```html ``` ### Custom toolbar button(s) There is also the option to add your own toolbar buttons via the prop ``custombuttons`` as an array of button objects. Each button has the following properties: | Property | Default | Description| |----------|---------|------------| |``label`` | null | The name of the button| |``key`` | null | This is used in the event | |``icon`` | null | Which Font Awesome icon | |``group`` | custom | In which group should the button be (basic, advanced, custom or other ) | When the button is clicked, an event is fired prefixed with ``insert:`` and after that the key. At this moment you can use 3 functions in your event callback. You can find an example here below. | Function | Params | |----------|--------| | ``insertBlock`` | start, end (default: start) | | ``insertImage`` | altText, src | | ``insertLink`` | title, link | ```html ``` ### All available Props | Prop | Default | Description | |------|---------|-------------| | ``custombuttons`` | [] | An array with objects to add custom button(s) to the toolbar. See example above. | | ``disabledbuttons`` | [] | An array of button keys of which button need to be removed from the toolbar. | ### Styling The styling of this plugin is based on Bootstrap and the icons are from Font Awesome. But this plugin also uses custom classes so you can easily change the styling. All custom classes are prefixed with ``.md-editor-*``. Below you will find an overview of all classes. | Class | Description | |------------------------|-----------------------------------------------------------------------------------| |``.md-editor-container``| The container surrounding the whole editor. | |``.md-editor-toolbar`` | Toolbar containing all buttons. | |``.md-editor-editor`` | The editor area itself. | |``.md-editor-preview`` | When you click on preview button this area shows up containing a rendered preview.| ## Requested features The requested features below will be implemented soon. - Rearrange toolbar - Support for keyboard shortcuts - Inline syntax highlighting - Side by side (editor and preview) - Autosave feature Do you have a feature request? Let us know via an [issue](https://github.com/mrdaano/vue-md-editor/issues)

近期下载者

相关文件


收藏者