Laravel Vue组件未加载数据
我正在用Vue组件测试Laravel 5.4。但问题是Vue组件没有显示在视图页面中 这是我的Vue文件: ChatMessage.vueLaravel Vue组件未加载数据,laravel,vue.js,vue-component,laravel-5.4,Laravel,Vue.js,Vue Component,Laravel 5.4,我正在用Vue组件测试Laravel 5.4。但问题是Vue组件没有显示在视图页面中 这是我的Vue文件: ChatMessage.vue <template> <div> <p>Message text is here</p> <small>Author Name</small> </div> </template> <script>
<template>
<div>
<p>Message text is here</p>
<small>Author Name</small>
</div>
</template>
<script>
</script>
<style>
</style>
加载app.js时没有错误,因为我已经在查看页面中检查了它。
有人能告诉我这里出了什么问题吗?在您的聊天信息.vue中,您只需要导出一个空对象,因为没有任何其他属性,如以下内容:
<template>
<div>
<p>Message text is here</p>
<small>Author Name</small>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>
短信在这里
作者姓名
导出默认值{
}
@Hola您可以从问题中删除解决方案,我看到您在问题中添加了此选项,如果其他人稍后查看此问题,则会产生混淆。没错,我想我已经检查过了!我已经编辑了..谢谢你的解决方案though@Saurabh也许你能帮我。看看这个:
require('./bootstrap');
Vue.component('chat-message', require('./components/ChatMessage.vue'));
const app = new Vue({
el: '#app'
});
<template>
<div>
<p>Message text is here</p>
<small>Author Name</small>
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>