vue-markdown icon indicating copy to clipboard operation
vue-markdown copied to clipboard

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

Open tech-xs opened this issue 3 years ago • 2 comments

代码

<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 库不支持导致的,需要升级应该这个库

tech-xs avatar Mar 02 '22 01:03 tech-xs

你解决了么

yimiyg avatar Jun 15 '23 04:06 yimiyg

请问解决了吗

kongweigen avatar Jan 22 '24 09:01 kongweigen