首页 > 解决方案 > 尝试通过 Vue 代码加入 Webrtc 加入但收到此错误

问题描述

我正在尝试使用以下代码开始视频聊天,但出现此错误。这是代理问题吗?

    doJoin() {
      this.$refs.webrtc.join()
      this.attendeeJoined = true
    },

我得到的错误

Uncaught TypeError: this.$refs.webrtc.join is not a function
    at Proxy.doJoin (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader-v16/dist/index.js?!./src/views/Chat.vue?vue&type=script&lang=js:61)
    at $props.user.$props.user.uid._ctx.hostID._ctx.attendeeApproved._ctx.attendeeJoined._ctx.attendeeApproved.Object.onClick._cache.<computed>._cache.<computed> (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader-v16/dist/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader-v16/dist/index.js?!./src/views/Chat.vue?vue&type=template&id=15964adc:100)
    at callWithErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:276)
    at callWithAsyncErrorHandling (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js:285)
    at HTMLButtonElement.invoker (webpack-internal:///./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js:546)

标签: vue.jsproxywebrtc

解决方案


推荐阅读