如何实施Twilio Vue.js教程
它是基于Laravel 6,我在2022年遇到了一些错误。 我已经通过添加AccessTokenController的完整名称空间来修复路线,
但是在教程中,我被要求“替换warey.blade.blade.php中的代码,
...
<script>
export default {
name: 'video-chat',
data: function () {
return {
accessToken: ''
}
},
methods : {
getAccessToken : function () {
const _this = this
const axios = require('axios')
// Request a new token
axios.get('/api/access_token')
.then(function (response) {
_this.accessToken = response.data
})
.catch(function (error) {
console.log(error);
})
.then(function () {
console.log( _this.accessToken )
});
}
},
mounted : function () {
console.log('Video chat room loading...')
this.getAccessToken()
}
}
</script>
但我认为作者犯了一个错误,实际上是指videochat.vue.vue.vue。文件内容。
但是粘贴的代码不起作用。我什至没有控制台日志。当我是vue.js的新手时,我想问社区可能是什么错误。
感谢您提前回答。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您是对的,您粘贴的代码应该进入
videochat.vue
。在
中welcome.blade.php
请确保已更换&lt; example-component&gt;&lt;/example-component&gt;
,用&lt; video>&lt; ;/video-chat&gt;
。然后,您应该在控制台中看到一些日志,并且应用程序获取访问令牌。I think you're right, that the code you have pasted should go into
VideoChat.vue
.In
welcome.blade.php
make sure you have replaced the<example-component></example-component>
with<video-chat></video-chat>
. Then you should see some logs in your console and the application fetch the access token.