Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
vue-markdown-doc
Advanced tools
vue的markdown组件,可渲染markdown文件
NPM
$ npm install --save vue-markdown-doc
Yarn
$ yarn add vue-markdown-doc
<template>
<div id="app">
<MarkdownDoc
:images="images"
:mdRaw="mdRaw"
:prevPage="{
title: 'SmartLinkTree 树',
url: '/docs/components/smart-link-tree'
}"
:nextPage="{
title: 'smartLinkInput 输入框',
url: '/docs/components/smart-link-input'
}"
/>
</div>
</template>
<script>
import "vue-markdown-doc/lib/index.css";
import MarkdownDoc from "vue-markdown-doc";
export default {
name: 'FormDoc',
components: {
MarkdownDoc
},
data() {
return {
mdRaw: require('./component.md').default,
images: {
'todo-ui-form.png': require('./images/todo-ui-form.png')
}
}
}
}
</script>
获取.md
文件流需要使用raw-loader
,配置参考官方文档
配置vue.config.js
function resolve(dir) {
return path.join(__dirname, dir);
}
module.exports = {
...,
chainWebpack: config => {
config.module
.rule('raw-loader')
.test(/\.md$/)
.use('raw-loader')
.loader('raw-loader')
.end()
}
}
参数 | 类型 | 说明 | 默认值 |
---|---|---|---|
mdRaw | String | markdown字符串 | - |
images | Object | 配置markdown中使用的图片,对于上例,在markdown中使用图片的格式为:{{"image": "todo-ui-form.png","width":1000,"height":530}} | - |
prevPage | Object | 格式:{title: String, url: String},配置上一个模块的跳转 | - |
nextPage | Object | 格式:{title: String, url: String},配置下一个模块的跳转 | - |
navFix | Boolean | 目录栏固定在顶端 | true |
scrollElementParent | Object | 页面滚动事件挂载的dom元素 | window |
FAQs
Markdown Parser for Vue
The npm package vue-markdown-doc receives a total of 3 weekly downloads. As such, vue-markdown-doc popularity was classified as not popular.
We found that vue-markdown-doc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.