Skip to content

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

@tech-xs

Description

@tech-xs

代码

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions