异常如下
errorHandler.js:24 TypeError: Cannot read properties of null (reading 'ce')
at renderSlot (runtime-core.esm-bundler.js:2966:1)
at Proxy.eval (vue-web-terminal.js:4849:1)
at renderComponentRoot (runtime-core.esm-bundler.js:898:1)
at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5631:1)
at ReactiveEffect.run (reactivity.esm-bundler.js:187:1)
at instance.update (runtime-core.esm-bundler.js:5745:1)
at setupRenderEffect (runtime-core.esm-bundler.js:5759:1)
at mountComponent (runtime-core.esm-bundler.js:5541:1)
at processComponent (runtime-core.esm-bundler.js:5499:1)
at patch (runtime-core.esm-bundler.js:5101:1)
请提供一下你工程的vue版本、vue-template-compiler版本、vue-web-terminal版本
版本应该是没有问题的,确认一下你是否在main文件中注册组件?
import { createTerminal } from 'vue-web-terminal'
const app = createApp(App)
app.use(createTerminal())
app.mount('#app')
以及确认在使用组件的vue中是否引入了Terminal
<script setup lang="ts">
import {Terminal} from 'vue-web-terminal'
</script>
如果都不行那可能和你工程的构建配置有关,你可以新起一个空工程引入组件看是否能正常工作,如果是正常的需要排除你工程中的一些配置或者其他依赖的影响。
登录 后才可以发表评论