miaolz123 / vue-markdown

A Powerful and Highspeed Markdown Parser for Vue
https://miaolz123.github.io/vue-markdown/
MIT License
1.92k stars 258 forks source link

vue3 错误提示使用时 报错 createElement is not a function #137

Open tech-xs opened 2 years ago

tech-xs commented 2 years ago

代码

<template>
  <Mgr>
    <vue-markdown :source="mdText"></vue-markdown>
  </Mgr>
</template>

<script>
import Mgr from '@/components/mgr/Mgr'
import VueMarkdown from 'vue-markdown'

export default {
  name: "WebDoc",
  components: {Mgr, VueMarkdown},
  data() {
    return {
      mdText: '# aaa'
    }
  },
}
</script>
<style lang="less" scoped>
</style>

image

错误内容

vue-markdown.common.js?9ce6:325 Uncaught (in promise) TypeError: createElement is not a function
    at Proxy.render (vue-markdown.common.js?9ce6:325)
    at renderComponentRoot (runtime-core.esm-bundler.js?5c40:893)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js?5c40:5030)
    at ReactiveEffect.run (reactivity.esm-bundler.js?a1e9:167)
    at setupRenderEffect (runtime-core.esm-bundler.js?5c40:5156)
    at mountComponent (runtime-core.esm-bundler.js?5c40:4939)
    at processComponent (runtime-core.esm-bundler.js?5c40:4897)
    at patch (runtime-core.esm-bundler.js?5c40:4489)
    at mountChildren (runtime-core.esm-bundler.js?5c40:4685)
    at processFragment (runtime-core.esm-bundler.js?5c40:4856)

推测应该是 highlight.js 库不支持导致的,需要升级应该这个库

yimiyg commented 1 year ago

你解决了么

kongweigen commented 10 months ago

请问解决了吗