Closed tech-xs closed 2 years ago
在仅预览模式下 这个函数是无效的 markedHeading 仅预览模式属性 previewOnly
<template> <Mgr> <md-editor class="body" v-model="mdText" @markedHeading="markedHeading" previewOnly/> </Mgr> </template> <script> import Mgr from '@/components/mgr/Mgr' import MdEditor from 'md-editor-v3'; import 'md-editor-v3/lib/style.css'; // import {getDocContent} from "@/api/doc/doc"; export default { name: "WebDoc", components: {Mgr, MdEditor}, data() { return { mdText: '# AAAA' } }, created() { // getDocContent('/web/webDoc').then(res => { // this.mdText = res // }) }, methods:{ markedHeading(text, level, raw){ console.log('aaaaa') console.log(text) console.log(level) console.log(raw) } } } </script> <style lang="less" scoped> .body { margin-left: 50px; margin-right: 50px; } </style>
抱歉,文档有点问题,请像下面这样使用:
<md-editor class="body" v-model="mdText" :markedHeading="markedHeading" preview-only />
在仅预览模式下 这个函数是无效的 markedHeading 仅预览模式属性 previewOnly