Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/luosijie/vm-markdown

Example
https://github.com/luosijie/vm-markdown

markdown vue-components

Last synced: 3 months ago
JSON representation

Example

Awesome Lists containing this project

README

        




example






### Install

```bash
npm install --save vm-markdown
```
### Usage

```vue

import VmMarkdown from "vm-markdown"
import "highlight.js/styles/github.css"
import hljs from 'highlight.js'
export default {
name: "app",
components: {
VmMarkdown
},
methods: {
onChange(data) {
// data = {html, markdown}
this.$nextTick(() => {
const codes = document.querySelectorAll(".markdown-body pre code");
codes.forEach(elem => {
hljs.highlightBlock(elem);
});
});
},
// your method to upolad the file to server
async uploadImage(file) {
const imgUrl = await this.uploadRequest(file);
return imgUrl
}
}
}

```

### License

[MIT](https://github.com/luosijie/vm-editor/blob/master/LICENSE.md)