Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luosijie/vm-markdown
Example
https://github.com/luosijie/vm-markdown
markdown vue-components
Last synced: 3 months ago
JSON representation
Example
- Host: GitHub
- URL: https://github.com/luosijie/vm-markdown
- Owner: luosijie
- License: mit
- Created: 2017-08-25T07:20:16.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-04T00:49:20.000Z (about 4 years ago)
- Last Synced: 2024-06-30T18:50:08.606Z (4 months ago)
- Topics: markdown, vue-components
- Language: HTML
- Homepage: https://luosijie.github.io/vm-markdown/
- Size: 2.68 MB
- Stars: 94
- Watchers: 7
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 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)